More major surgery.
Added runtime and thread abstractions and stack rooting.  Fixed up heap rooting code.  Other minor changes.