Turn module and application into DI containers.
refactored code to use Instance::ensure()