completed work on #41
retaining readability, revert change
save received config in a local file
open config files in write mode
Merge pull request #83 from czardoz/master

completed work on #41