Moved all filenames into the locals module, and made various other minor

refactorings.

Part of #87