Add pre/post interceptor hooks

This allows interceptors to hook into the processing before incoming data is deserialized and after outgoing data is serialized. It also fixes a bug where using interceptors without all hooks configured would result in an exception.

I'm happy to split those two concerns into two separate pull requests if you'd prefer.