Ipns name resolution

This branch is not yet complete, but before i move forward, the name resolution code (in namesys) needs some critiquing. There are also a decent number of bugfixes in this branch that i ran into while trying to get the code to a point where i could test ipns.
general comment: +1 to all the interface sanitation things. doesnt matter much for plumbing, but particularly for methods that are close to the surface of the library, double checking + meaningful errors all over the place will be very useful for users.