Adding a debug mode toggle

Author: lhunker