Made server code mostly compliant with the JavaScript Style Guide from Airbnb [1].

[1]: https://github.com/airbnb/javascript