Rewrite of UI initialization

Split it into a bunch of different functions.

No helper functions because apparently most of my UI code is pretty
unique and not refactorable, or at least not easily.

Change-Id: I8209fd91ec6788c26b8dea26d97c26f8231ddbbf