issue 1689: fix menu highlighting with browser back/forward buttons

Pjax only runs inline JS once, so the model highlight on the left nav
didn't change when users navigated with the back and forward browser
buttons.  Added some code in ui.coffee to run code inside script tags
when pjax notifies of a "popstate" event.