Reworked panel dialogs (again) so that dialog templates are moved into dialogs without losing bindings etc