dict-based query/scope system base code

testing is to be done!