jQueryUI: corrected return type of some dialog methods

jQueryUI: corrected return type of some dialog methods in line with jQuery UI documentation ( http://api.jqueryui.com/dialog/ )

Also corrected / added a couple of tests.