Listen for popstate events so back button works.