Implemented driver-compat json serialization on top of JSONWriter