Prepared for new module system

Modified main application controller for use with new module system +
general logic improvements