[OE-2664] first bash at standardising the way javascript is passed through from the controllers.
Merge branch 'jira/2664' into release/1.3-moorfields
[OE-2664] tweaks suggested by mike+jamie
Merge branch 'release/1.3-moorfields' of github.com:openeyes/OpenEyes into release/1.3-moorfields