CMakeLists.txt can now run tests.
test_execpermfix: removed valgrind execution from here.

We should do it from somewhere else.
CMakeLists.txt: invoke valgrind tests.
General refactoring (lib & main split); testhelper added.
CTestConfig added.
Old python unittest removed.