Add jshint
Fix jshint errors
Add tests