Wide refactoring of WebUI, UITab, and UIPage

See commit message for more detail.