Added debugging facilities to support filtering out debugging messages.

Signed-off-by: Jakob Brandsborg Ehmsen <jakobehmsen.github@gmail.com>