More mature version of tabs with extra configuration, plus some refactoring and minor fixes