add tests to ensure cache is working properly
do not force HashDict values to be strings, they could be bytes
add tests for encoding and fix a few encoding bugs