Added `ground` query fn, fixed query predicate/fn calls without free vars (closes #25)