Add tests for coordinate file writing, and fix a few small issues with restart
file writing.