Fixes: #2159.
Do a (superficial) port to c++ of some of the c sources. Update deps. Fix a few compiler warnings.