kvstore: typed encode/decode: test field reorder and empty map→pointers