Code cleanup

Refactored a lot of code mainly in new KafoConfigure class.