DNS bugfixes

This fixes a few bugs in the DNS code, and introduces a test to avoid some of them happening again. 
(it used to be the case that logging in with login `foo` and password `bar` caused an undefined error, now it at least causes `errnoException` to be caught vaguely sensibly.)

This pull request also improves the README to explain a common string-prep problem and fix. 

TESTED: 
* ran interactive end-to-end test
* grunt test (note: selenium end-to-end test seems to be broken)