Modularized opening, reading, and creating files

Moved opening, reading, and creating files into separate methods for
modularity, reducing redundancy and preparing future alteration to
editing interface.