refactor dns classes into library, create value classes and tests