Implement layer architecture, refactor operation handling
Implement layer architecture, refactor operation handling

Operation._wrap now hooks the bottle route up to an invocation of
handle_request which builds a sort of request context (not related to
bottle.request, this is an entirely new context dict) and then
invokes any handlers (usually layers) registered with the service.

Moving the handler out of the wrap method helped a bit with the crazy
indentation, and cut down on a very large method that didn't need to
know all the gory details of how requests worked.  Two thoughts on
the current implementation:

1) If an exception is thrown by a layer during the on_exception event,
it won't get caught and wrapped up as an internal error.  This is a
bug that needs to be fixed.

2) As written the BasicValidationLayer is _required_ by all Services,
since it is the only one that translates context["result"] from a
list into context["output"] a dict.  This should probably happen in
the wrapper, similar to the input dict -> list translation.  That way,
the BasicLayer isn't required and an ordering is no longer required.
Further, the "result" field can be dropped from context entirely,
since it should only be translated to the appropriate dict*.

(There is still the possibility that output fields will be added or
removed by hooks that occur after BasicValidation, but the only way
to check that would be a hardcoded "on the way out" validator.  This
might be necessary.)

numberoverzero/pyservice