Savegame mechanism and tests.