Better exception logging

This code helped in debugging (uncaught) exceptions.  The two main changes are: (1) the addition of the shelveUtils.execeptionWrap function, which wraps a function such that if that function throws an exception it will be logged and a stacktrace (if available) will be logged, and (2) setting up the addEventListener function to wrap all listeners, which helps in both detecting and debugging uncaught exceptions.