Use location.hash to change state, and replaceState for the hash.