Add autosave functionality

We save 3s into every pause. Logic suggested by Arnt Gulbrandsen.