Add an implicit toSerialized method