Add jshint config and lint the code

Surprisingly few problems.
Add some unit tests :3