Fix: make undo history play nice with replaceState().
History: restore state gracefully when going forward.
Fix: set correct state when using History.replaceState().

Also make view_loadout F5-safe.