Adds a jshint config file and improves the code based on this