Only define debug function in debug mode.
prepend every call to debug with a check for debugging.
Merge branch 'disable-debugging'