Feature/now 195

can we move the local vars to the top?
var origin, scriptUrl;
origin = ....
scriptUrl = ...