Fleshing out test cases (and interface) for nodesdb.

Code doesn't compile yet, because I'm writing the test cases
first.