REwriting TupleQuery to be more flexible.

Now supporting 'or' statements