Backported JsonSerializable for PHP 5.3

Polyfilled JsonSerializable for PHP 5.3