Cleaned up JavaScript according to the JSHint rules outlined in jshint.json