Added jshint and jscs and reformatted code

Fixes #1