Fix README example.
Make sure object keys are strings.
add basic encoding tests