Re-order a few lines in server.js, add comments