push logic out of ui
remove indirection layer
fix main problem because of dynamic scoping

That was a pia problem. I can see the issues that go with duplicate
names that are fairly easy to cause.
get unit tests working with new style