Keep location.hash.

It works when stepped in debugger... but not without breaks.
Refactor search and location update code.