Trampoline

This change also includes necessary bug fixes to the new AST factory wrapper, and also to the pretty printer.  If this change is controversial, I can pull those changes out into a separate one.
This needs inLoop = false.  The comment is out of date with the implementation.