Fixed a JSON parsing bug in RestClient implementation.

Previously the JSON parser was tied to the RestClient. This caused
a problem as the requests passed to the client couldn't keep track
of which parser tha client had when they were enqueued.

The new implementaion instead ties the JSON parser to the request
itself. It is now guaranteed that the request is using the correct
JSON parser when parsing its result.

given time