Refactored UI

* Moved UI into separate files
* UI mostly self-contained (will finish this later)
* State files significantly less cluttered, less duplicate code