Implemented save functionality in the IO classes.