some refactoring of main script to ease testing
working on code coverage, up to 38% on dnstest.py; once we get max, then need to investigate checking all branches/paths