Refactor and re-enable 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.
I'd handle this differently. You are die-ing in other places of this file, anyways so:

```perl
sub assert_supported_format
{
    my $dbformat = shift;
    if (!grep {$_ eq $dbformat} @db_backends}) {
       die "Unsupported CCM database format '$dbformat': we only support ",
          join(", ", @db_backends);
    }
}
```