Linting with JSHint

I looked for potential bugs with [JSHint](http://jshint.com/). Originally, `jshlint .` output 38 errors, but I was able to clear most of them away with `.jshintrc`. The few remaining were relatively easy to resolve. Now forever passes JSHint!