Move all file functions off to its own source file.