Refactored error passing.
Macros and examples.