Add serialization from and to pack.