Renamed some internal classes, added save functionality.