jQueryUI: correct return type of dialog methods

Also corrected / added a couple of tests
Merge pull request #1336 from johnnyreilly/master

jQueryUI: corrected return type of some dialog methods