Handle encoding/coercing/validation in the encoder

Rather than having the dispatcher coerce and validate responses or handle that in a separate middleware, move it all into the encoder.

This should make it easier for other middlewares to hook in before or after the coercion and validation.

// @localshred @abrandoned