Added fallback to JsonSerializable for PHP 5.3