Added autofocus and autoclose features to modals.

Improved message box to autofocus the first option.