Bug 983193 - ui/button: passing a button into button.state() is broken in master

- Fixed regression
- Added tests