Improved indexes to support inequalities
refactoring
Initial implementation of Query object