Initial transcription Cython->C++ complete (untested).