Ran through code with jshint and closure-linter

Changes include:
 * whitespace changes per Googles style guide
 * breaking some long lines
 * explicit boolean conversions
 * jsdoc fixes
 * syntax fix, which prevented running the program
Convert tabs and remove trailing whitespace