C++ class for generating JSON objects