Revert "Revert "Modularized opening, reading, and creating files""

This reverts commit 5efb5cf8c35863e585c8db3ac90b5e4afecce8b5.