Fix for Bug10370. Autosave

Only https://github.com/paulcadman/reviki/commit/ed1d2fd0ebb51a65818a95e2dd0895d80ca5408c is relevant here (I based this branch on the pretify fix to make merging easier later).