Refactor and add tests for module API

UI parts within the ```services-manager``` have not been adapted, new PR will follow once the module API is done. Also clients parts not done yet.