Well-structured helpers to help serializing commonly encountered structures to JSON.