Updated JavaScript files to comply with jshint and jslint