Refactored server.js and placed configuration code into their own respective files.