Changed internal handling of tab-to-sidebar-to-tab management. There may be some bugs.