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 
To clarify a little regarding `cometServer`: that's designed to make it so you can avoid per-domain connection limits by using wildcard DNS and pointing each page to its own random subdomain. You can always make a different domain for anything work, all you have to do is have the DNS set up properly and a server that will accept connections at the other domain and forward them to the application as needed.