Replaced debugger with a new implementation.  Also fixed up a few #if/#ifdef
inconsistencies.