Fix a couple of Ajax related path issues

  - Include context path when generating page specific JS
  - Include context path when making Ajax requests
  - Fix Ajax path matching (previously renderVersion was being set to
    "ajax")

fixes #1591 
Makes sense. This would also let us avoid defaulting cometServer to S.contextPath (which is rather less than transparent). This will touch a few places, but fewer than I would have thought.