cleaning up server.js in prep for major modularization