Beginnings of C++ rewrite