Moves all code from todebug into a new class. Also caches the compilation unit in order to fix a LLVM 3.4 compile error.