Replaces `uncaughtException` with `prepareStackTrace`

`uncaughtException` doesn't work well with majority of test harnesses because they catch and display exceptions. This patch replaces `uncaughtException` console logging with a more "correct" way that better integrates into most stacks and leaves it up to the user to decide what to do with exceptions.

This is a direct port of functionality with a few additional tests.

Thoughts?