Add a test for HAVING.
Special case workflow() for ExprBuilder(DocVar).

Mostly just cuts down on tmp names, but does manage to eliminate a few
unnecessary `$project`s before `$map` and `$unwind`.
projectIndex now uses $simpleMap instead of $map.

This makes merging possible in more cases and eliminates `$foldLeft`.