Implement first rev of LZ encoding