Last of the C to C++ changes

Added TLS wrapper
Small change to cge_log.h