New middleware API

Alright, you alread know what's in here; I'll work on an annoucement for the mailing list soon.

New packages on PyPI would be nice!

Thanks