Functions to read and write configfiles and appropriate unittests