C++ exception handling and custom crashes

Adds support for catching and reporting uncaught C++ exceptions.
Also adds support for custom user-defined crash reports (useful for reporting scripting language failures).