First refactoring of the dns2mdns logic which actually has unit test to sanity check it out.
Linux compilation fix for test_dns2mdns.
Added freeing of structure (just to look at valgrind results; no leaks found).