Refactored datum object/array serialization