Add S3 serialization and deserialization code