Refactored server side js files to comply with jshint