Changed and added a lot

Version that works on simple an single queries, not yet for multiple
queries and not yet compatible with OpenRefine