Streamline creation of scratch buffers.

The logic on this was a bit scattered before, but I've found a nice
concise way of closing unmodified untitled buffers and then opening
either "Untitled Buffer 1" or "*scratch*" as appropriate if the mode
is being enabled or disabled.

By connecting to global-gedit-mode-hook I avoid some bugs where
certain buffers disable gedit-mode locally, which triggers
gedit-mode-hook unhelpfully.

This commit also introduces some basic tabbar support.