Add a few functions for tab management

See also my corresponding PR on crab-emacs.