Removing usage of cg-lib
Fixed test suite, removed CG lib dependency