Make the write*map methods more self-contained. Document some more.