(docs) Refactor and document server.js