Add uncaught exception handler to prevent crash

Catches uncaught exceptions, logs them to the console along with a stack trace

This prevents a full crash when the build tool is watching for file changes