Rename serialize and deserialize -> toJSON and fromJSON