Refactors as module; adds Application class