Rest exception marshalling

Following up to a discussion with @iigorr:

This pull request adds a facility to change the ways exceptions are *marshalled* (the way the exception is represented as a value) without having to exchange the entire exception *mapping* mechansim (the way the payload including headers is represented).