Ran through jshint and fixed coding standards