Update ui.dialog to use cordova.exec and events

Reviewed by Jeffrey Heifetz <jheifetz@blackberry.com>
Tested by Tracy Li <tli@blackberry.com>