More navigation tweaks.

- Use history.state to remember state across refresh.
- Only changing the index mode from the menu saves it as default.