Refactor Module class

The class is quite complex and becoming difficult to maintain. Need to review design and look for opportunities to simplify the Module implementation by extracting sub-classes.

SOLID: https://en.wikipedia.org/wiki/SOLID_(object-oriented_design)

"Interface Segregation Principle": https://en.wikipedia.org/wiki/Interface_segregation_principle