Improve exception handling.

Such that a source error caught by an uncaughtException handler now
wraps the source error and prints the stack trace for the source error
which is much more helpful when trying to debug uncaught exceptions.
Update uncaught error example program.