Trap any unhandled exceptions raised in the main function

This got lost in the conversion.  Now unhandled exceptions will have
their trace printed.