IModular and module stuff refactoring. Add an enum for module types.