Add H.is_running_in_standalone_mode
Save state before sharing if necessary
Restore state before sharing if necessary
Avoid reloading when restoring state
Merge branch 'back-to-the-last-page-in-standalone-mode'

Close gh-31.