Lempel-ZIv encoder/decoder functional, if a bit hacked together.