Refactored lib/server.js to use promises and avoid chevrons of DOOOOOOOOOOOOM!!