More javascript cleanup
Merging in upstream
Merge pull request #58 from lossyrob/js/cleanup

Js/cleanup