Moved some stuff to cpp-lib