Better attempt at pushState/popstate.