Replace all use of location.hash with history.replaceState()