Started to the port to C++

Started to move both the convert and unconverted function to C++.