Widget: Avoid adding extra spaces to the result of this._classes(...)

Closes gh-1372
Dialog: Fix checking of $.uiBackcompat in tests
Tooltip: Update checking of $.uiBackcompat in tests
Dialog: Simplify tests for classes
Accordion: Simplify tests for classes
Dialog: Simplify tests for classes
Menu: Simplify tests for classes
Progressbar: simplify tests for classes
Selectmenu: Simplify tests for classes
Slider: Simplify tests for classes
Tabs: Simplify tests for classes