Middleware interface and pluggable body decoding

Middleware now takes an object and the body middleware will use all
registered decoders.