fix collector_setup.sh to allow hyphens in the hostname and add unit tests
collector_setup.sh changes the strings for collector and CCB addresses to allow port ranges that can be set in the configuration (see [#7341], [#20909]).
There is a problem in the regular expression in the replace_range function that fails when there are hyphens in the hostname and a sinful string is used (shared port enabled).
A fix was suggested in PR38 https://github.com/glideinWMS/glideinwms/pull/38
To limit future problems I'm also revising the script and adding unit tests