Move more code out of ui.main, rely on options module rather than keeping a bunch of hidden elements