runtime: refactor internals for better access by tests
tests: simple packing encoding tests
tests: simple packing decoding tests
tests: unpack(pack(x)) = x for all x
tests: unpack(fragment(pack(x))) = x for all x