JS work on app navigation (and partially working ajax)