Added support for the close value to the openModal() function as well.

Added support for the close value to the openModal() function as well. The value used for the closeThisDialog(value) call is used as the reject reason of the promised returned by openModal().