Added sorting of tabs.

All tabs are sorted by their weight attribute.