use script_root in absolute links to support subdirectory URLs

Hi, 

we needed to install rsted in a sublocation ( foo.com/rsted/ ) and with https enabled. So I did a few changes:

* Change Templates to use `request.script_root` in absolute paths
* Set `request.script_root` as a Javascript variable `script_root` in global context in `base.html`
* Use `script_root` for URLs generated in Javascript
* Use `//...` instead of `http://..` to make links protocol agnostic and support https. 

Our Nginx configuration for running rsted as `/rsted/` using uWSGI looks like this:

```
	location /rsted {
                include uwsgi_params;
                uwsgi_pass unix:/run/uwsgi/app/rsted/socket;
                uwsgi_param SCRIPT_NAME /rsted;
                uwsgi_modifier1 30;
	}
```

Thanks for that awesome piece of software.