Added support of JsonSerializable interface

http://www.php.net/manual/en/class.jsonserializable.php