Reformat js:

fix indenting (2 spaces),
spaces around brackets
add semicolons
etc.
Merge pull request #155 from ninjadev/reformat-js-rebased

Reformat js: