Use assertions about the pushback buffers to simplify their handling.
Mark several things left TODO.  Some tidying.