Fixed UF-128: UberTabPanel overflow logic is unstable

Also includes a (hopefully) comprehensive set of tests for tab panel behaviour
and fixes for some other issues that existed previously.