Changed the query creation code to build a manual query (needs checking)

Can now also provide a JSON array string as a $_GET with a full user
created query. eg.
filters=[{"field":"client.name","operator":"like","value":"ceta%"}] -
we will probably want to rawurlencode or something...
Added new function to  encodeURIComponent($str) which works the same as the javascript function.
JSON based filters can now handle between quite nicely (unescaped).