Add hashchange listener to support back/forward buttons