Do a (superficial) port to c++ of some of the c sources. Update deps. Fix a few compiler warnings.
With the new logging setup, we need g_printerr