Refactored UIModule

Using the same code as the ModelType stuff now.