Added from_json, removed toJSON