Major improvements to the dialog API.