More code cleanup.
Move the command list into its own class.
Move the main toolbar into its own class.
Rename a bunch of unused variables.
Move lots of scattered state change functionality into CommandList class.
Code is much cleaner now, but look out for regressions!
Change attributes that only got used in __init__ methods to variables.
Fix some regressions introduced in 2bde026302154ce9ce580ad07253c3c13b0a2e22
There may be more.
More code cleanup.