Working towards cleaning the code up.
Cleaned up to use TclOO to manage more of the state.
Some shortening of the wordier bits that remain.