Ticket #873. Call write_config() before including file to avoid loosing already done modifications. While here do some code cleanup and formating to make it more readble.
Related issues
Bug #873: deinstall does not unset package <menu> and <service> tags from /conf/config.xml
Ticket #873. Call write_config() before including file to avoid loosing already done modifications. While here do some code cleanup and formating to make it more readble.