Refactor errors module

The errors module now has "errors" for Node.js Error objects, and
middleware for error handling middleware and middleware for less severe
problems.