This makes these operatios use constant stack space rather than linear stackspace given the size of the inputs. This is important to prevent certain parser input from causing a stack overflow - in general, we try to avoid unbounded recursion.
The layout should actually be very similar to the old layout, but the code will be much easier to change and should be more portable.