Extract logging and stats into a middleware

Instead of capturing stats all over the place, rely on the env object and middleware placement (between the decoder and encoder) to capture everything we need to log requests and responses.

The embedded instrumenter is a stop-gap until we can get things switched over to use Active Support's notifications to track and log.