Added jshint, cleaned up code resultingly