Moved C++ code into legacy, and added the new python classes.