Rewrite of server.js with modules