Adds JsonSerializable interface workaround

[FEATURE] Compatible with PHP 5.3; Adds JsonSerializable interface workaround;
Have not tested on versions below PHP 5.3