Initial checkin of query REST API
REST API: support for json content-type, new request arguments.

Adds support for json content-type, and new arguments in a request
(signature, format, pretty, compression, encoding). Request id and
results size given in the output. Processing of positional and named
arguments in the request.