silence debug output

Added a debug flag that defaults false, and a set_debug function to
allow setting it.  Conditioned the debug output on the debug flag to
remove the noise.