Allow non-generator functions as middleware.

This change makes it possible to call `app.use` with a normal function. Any
normal function used as a middleware will be wrapped in a generator which will
properly yield to the next generator in the middleware stack.