Refactor and re-enabe unittest to prepare for some speed optimisations

Preparing to make CCM fast enough for https://github.com/quattor/ncm-query/pull/5, came to the conclusion that CCM needed to run all unittests first.
This massive block looks like:

```perl
if (exists($ALLOWED_CONFIG_PARAMS{$var}))) {
    $cfg->{$var} = $val;
} else {
    # error here
}
```

Please refactor this one. :smile: