Tidy logic around getting and setting tab states when changing selected tab.
Tidy logic around getting and setting tab states when changing selected tab.

skyglobal/web-toolkit,image-tester/web-toolkit,aldreth/web-toolkit,image-tester/web-toolkit,aldreth/web-toolkit,image-tester/web-toolkit,aldreth/web-toolkit,skyglobal/web-toolkit,skyglobal/web-toolkit