Added middleware to provide useful debug info.

Added middleware that will, when in debug mode, presents helpful information
specific to certain exceptions.