Added support for multiple module sources
Refactored entry-point into testable code