start moving everything to C
C++ cleanups. (in progress)