Add equation resolver. Refactor query api.