Update documentation for middleware

Middleware docs were missing a few features mentioned in the previous description, as well as some stuff present only in the source.