Pulled out some of the functionality for reading/writing to a file into a new DataFile class