Make C++ to JSON conversion system uniform and extensible