Refactored server.coffee

@sderickson Just wanted your approval, I refactored the server to be more easily comprehended and removed redundancies. It passes all of the tests.