refactor tests with t/test.pl

add utf8 tests. TODO: decode the utf8 key.