Tweaks to popstate handler. Binding to popstate in general init instead of ad-hoc