#38 - Port the Twitter middleware from katana

This is a direct port, no surprises.
Note I've changed these so they are no longer publicly settable.