added urlparams directly to the request and added other global variables and ways to access them from the controller to fix #677
spaces to tabs