Added methods to read from and write to files. Still need to clean up quite a bit.