Middleware for Connect which provides globally accessible request context with lifecycle hooks