[config] Implement a test and a fix to #26
This MR introduces a test and a fix for issue #26 (closed). The file handling (which was inherited from the previous implementation), had a bug in which it did not truncate existing configuration files before re-writing them which sometimes created invalid files.
Closes #26 (closed).
Edited by André Anjos