Support for JsonSerializable (see #2)

This PR adds support for JsonSerializable.
It also supplies a stub of JsonSerializable that can be used on PHP versions pre 5.4.0.