Adds tests for server.
Adds error handling for middleware; separates middleware into its own lib+test files.
Moves coverage summary middleware into middleware.js and out of server.js; adds tests.