Autosave and save on quit

When exiting to the main menu there should be a confirmation message asking whether I want to save first.
Additionally, there should be support for regular autosaves (ideally with a configuration for the number of automatic savegames, but for the start it could be fixed to 3 or even just 1).