Add application factory

Refactor application building into an application factory to allow
separated and testable instantiation.
Remove unnecessary CLI controller
Add missing license
Prepare cli for subtree split