Add savestates, fix quitting via main window