Made some changes to allow libcsearch to be used with C++