Added serialization & tests