Add Query abstraction.
Replace criteria dictionaries with queries.