Implement name_scan and name_filter.

Fix https://github.com/namecoin/libcoin/issues/8 by implementing both name_scan and name_filter in libcoin.  This supersedes https://github.com/namecoin/libcoin/pull/14 with an extended patch that implements both functions.

Please test and discuss here, but do not merge.  I will try to get it merged upstream.