Merge pull request #18 from xStrom/master

Improvements to the query system