start of the c++ port, not tested
Merge branch 'master' of https://github.com/delmottea/libCMT