Simplifications and tidying up of stack management issues.  Work in progress.