Overhauled saving

It now works properly on Android. Saving is done automatically when the application is paused.