[network] Fix initialisation/cleanup
Add profiles

This allows modules to be used multiple times, but with different
parameters. They can be passed by appending them to the module name with
an underscore. Some modules may evaluate the profile name (a candidate
may be the mpd module, where it might get used to pass the location of
the music server), others will simply ignore it. But it still allows to
configure multiple versions of the module separately.