Added more daemon functionality. Ability to write config files