(docs) Refactor and document server.js
Merge pull request #97 from noodle/master

(docs) Refactor and document server.js