add tests for TemplateButtonPanel; make ITemplatePanelTest more robust because of this; some testing changes