Refactoring tabs system

codebot.ui.tabs.js has the implementation of tab logic.