2nd half of GUI refactor. Hopefully not too much is broken.