Fix a bunch of jshint errors, generalize tests.

This change fixes a bunch of errors found by jshint. Most of these are silly
things like missing semicolons. This also changes our use of 'public' to
always use string notation, so that we're not using a reserved word.

When I was running the js-tests, I found that different browsers used different
orders for attrs which had been added from javascript when calling .html().
This meant that several of our field tests broke when running in firefox. I've
changed this to test more generally instead of looking for specific html
strings.

Testing done: Ran js-tests.

Reviewed at https://reviews.reviewboard.org/r/5595/