Fixing issue #73: debugging snippet gets in the way

Two notes:

  * I am just starting to test this now, so this pull request is sent in order to get a code review.
  * I have added the option to specify ``debugHandler: null`` in order to disable debugging entirely. It is an odd way of doing so, but will preserve backwards compatibility.