Implement better tab closing

When tabs are closed then previously used tabs will be selected,
rather than just the first tab.
Merge pull request #35 from nccgroup/better-tab-closing

Implement better tab closing