Fix build, save files atomically, and quit on Ctrl-Q

This fixes #16, #28, and #32.