Sanity check arity of new middleware
Merge branch 'middleware' into middleware-idea
Handle errors in synchronous middleware

If synchronous middleware throws an exception,
- catch the exception
- emit an 'error' event
- call the latest 'done' callback to unwind the middleware stack

Async middleware is still responsible for performing these steps after
it yields to the event loop.
Rename an ignored variable
Cleanup syntax in middleware example
Document the middleware API
Merge branch 'middleware' into middleware-idea