updates to the js

minor spacing/whitespace fixes + jQuery optimization

warning: I didn't test this; you should before you merge.