Add documentation to Query.js for jsdoc3
Add exceptions to deal with QueryAPI error codes
Adapt Query.js to new specifications of QueryAPI