Support for running discourse with a prefix (i.e. as http://servername/discourse)

The following changes allow running Discourse with a prefix such as /discourse. The change does not affect running Discourse without a prefix.

The number of changes is large, but most of it is un-hardcoding the URLs for requests. It also includes Discourse.getURL() that uses rootURL to format the URL accordingly.

Running Discourse in a prefixed environment still requires changing "rootURL" value in JavaScript files directly, but is possible and all of the URLs work properly.

The code does includes changes to most of handlebars templates. For the remaining links, they work fine because JavaScript events capture and route them, the only thing not working is opening those links in a new tab.

We are working on getting those links working as well. If you have any suggestions on how to fix it, please let me know.