Fix back button, implement onhashchange

Slightly clean up code, but leave hashchange fallback for IE7 :/