Jslint

A bunch of JSLint-inspired changes, though only partially complete. If you haven't used JSLint before, it may be annoying to stick to its opinionated view of coding styles (and using JSHint instead of JSLint may help get around some of that, if you prefer), but a lot of its recommended practices are quite sane and valid, and more importantly, once one gets it up to standard, it tends to quickly highlight bad or old code.

I can work on doing more, but I didn't want to waste time if you had strong opinions against changing your coding styles accordingly (in which case, again, JSHint might meet your needs as it is meant to offer greater configuration to one's own project tastes).