Progress on codegen for forall query.
Add test for query.