Slightly refactor code
Add server code to be tested with jshint
Fix jshint warnings