Implement ExprFactory. Simplify CountExpr/SumExpr.
Fix tests.