Bug 1041205 - Fix style guide violations

This makes the JS/HTML code conform to the [Mozilla webdev style guide](http://mozweb.readthedocs.org/en/latest/js-style.html).
I suppose we could fix this while we're at it, but I can do that separately.