include: Move callback helpers to C++ code