Introduce a define to switch on debug output.

After re-writing the same loop multiple times, we deicided it's time to
add this as an optional debugging help.