some optimizations, tests and more s/ahuexception/pdnsexception