Moved glstat_fmt to C++ and started work on it