New unified debugging function

This is kind of inspired by http://api.drupal.org/api/drupal/includes%21common.inc/function/debug/7

More details are in the first commit comment.

Let me know what you think!