implement the new kvstore api and refactor tests to use kvstore/testutil