Removed use of JsonSerializable, since this requires PHP 5.4, and replaced JsonSerialize() with getJsonData()