API for operation with modal dialogs

This extends on PR #1037 
yes - its handled in reset now, so the line can eventually go away