Slight fixes to `Client` to set the G2M endpoint as long as the request is not for authentication because that has a different endpoint.

Implemented the `\JsonSerializable` interface on all models to provide a way to JSON-encode the object properties for use by other components. Model unit tests extended to test implementation.