Refactor settings.js templating to support root pages

The previous settings.js templating assumed that the URL always contained
an instance ID. Now that we are starting to add 'top-level' pages (e.g.
user page) we need a settings.js template that works without an
instance.

As part of this change I fixed script src urls with double slashes and
added a simple context processor to make the SITE_ROOT setting from
settings.py available to all templates.

I changed mimetypes from application/x-javascript to the now standard
application/javascript (reference: http://stackoverflow.com/a/9664327)
Merge pull request #101 from jwalgran/topic/root-config-js

Refactor settings.js templating to support root pages