refactor(server.js): Modularize code into separate files, add comments, remove unnecessary code