JS determines UI root from location

* Fixes #519
* Jenkins: http://jenkins.buttonweavers.com:8080/job/buttonmen-cgolubi1/242/