fix empty/null keys
add more tests, fix reverse ordering when opts.key
 more tests, fix startkey/endkey range error