Added IO stuff for saving data to file. Not finished but I'm going to do a risky move.