Refactored modules API, changed from singleton to DI.