Added basic support for modal dialogs.