DAR-2604: promise support for modal events
DAR-2604: modals - adding beforeClose event