Refactored code to more cleanly serve static content using serve-static.js