Add serialization/deserialization of events array.