New get_ref/reset methods for fine-grained (if undocumented) internal
access. Make _notes persist better so get_ref has something stable.
Improve write_file. Test that groenewald_bach.scl in is
groenewald_bach.scl out via write_file.