decoder: fix string decoding
decoder: improve decoding support
test: add a bunch of tests