Jscs fixes

Don't merge just yet, but this is an example of the kinds of errors JSCS (javascript code sniffer) finds.