Print only in DEBUG mode.
Improved output, and debug messages. Added timers to measure
performance. This code will soon take place of the main applications.