implemented clang-style error handling
improved exception handling API: on_error(first, last, x, context)
some cleanup