CMS-3199 Default focus when opening modal dialogs

- made default buttons focused in dialogs
- fixed ElementRegistry getElementById and removed element from registry on remove from dom
- also refactored remove/removeChild/removeChildren methods