Tk File Deleter Fixes

This fixes the silly file deleter problems for me.  The previous version of the code violated the one definition rule many times.  I am a little surprised it linked even.

Note that I had to revert the cli test movement commit 56af811 because cmake wouldn't configure.  I think you may have forgotten to add the tests/cli/CMakeLists.txt file and it was giving me obscure error messages about not being able to link against pthread.  

In any event this PR builds and tests for me just fine.