Quary engine

Resolves: #28 #42