Reformat JS/HTML files to comply with style guide

Used js-beautify to reformat the JS/HTML files to comply with the [Mozilla style guide](https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style).

For easier review, here is the output of `git diff -b master..` (ignores changes in the amount of whitespace): https://gist.github.com/anonymous/0e5deb819398515b0995