Add some functions for tab management.

See also my corresponding PR on crab-chrome.