Typehinting on stdClass doesn't seem to match any object as I expected so I've removed the type hint and added a check on the argument instead.
Removed a few more invalid type-hints on stdClass.
Adding tests to make sure the Serializable object interface is used correctly.
Added an extended interface that takes the JSONer itself so that objects can prepare their own data using the same encoder.