Introduce the concept of a middleware stack

In order to make PB more extensible, this introduces the concept of a
middleware stack. It is invoked from the server and terminates at the
dispatcher. The dispatcher returns an error or response proto which is
then added to the response wrapper accordingly.
Embrace the environment object

Double down on the env object used to pass stuff to the middleware:

- Use it in the dispatcher store the response and return it instead
- Use it in the server module to access stats, set the request, and
  process the response
Extract request decoding into a middleware
Extract exception handling into a middleware
Extract response encoding into a middleware
Extract stat tracking into a middleware
Move all middlewares under the Middleware namespace
Extract logging into a middleware
Add a proper environment object w/ accessors