Added docu, writer outputs a "auto generated" comment at top of cfg
file, modified some functions.