Optimized LZW encoder.

LZW now adheres to our expectation of taking a list of streams as an
input and returning a list of streams with the encoded code values as
encoded replacement.