History tweaks

Probably needs some more testing, but these changes on Chrome at least make the app behave more naturally when moving back and forth in history: anchors are used only where needed, and you are scrolled to what you want to see.