More metadata cursor implementation.

Copy keys in when required
Update test case.

Now next, prev and search should work.

Still need to implement search_near, test error conditions, and look for
memory leaks.