Move all the module types out into their own module and refactor accordingly