This adds all the support for top-down traversals and constant prefolding that was
reverted in this patch:
This has two changes from the previous patch:
- It disables the 'processExistingConstants' prefolding call when doing a bottom-up traversal.
- It defaults applyPatternsAndFoldGreedily to bottom-up traversal instead of top-down.
The consequence of these two changes is that there is *no behavior change* from this
patch. We can stage in the new behavior on a case by case basis over time.