Move OKS_commit form C++ to C implementation