Bug fix: Decoding corner-case

There was occasions when the decoding code did not construct the
correct uncompressed string due a memory management problem.
More encode+decode tests

Adds a handful of test to check that the encoding+decoding of a given
strings returns the original string.