Update tabs.js to better support dynamically adding tabs.