lzma: support for the length codec and bigger changes

This commit provides a number of changes.

The direct and tree codec consist now of a single value supporting
Encode and Decode methods. Defining Encoder and Decoder seperately
requires only additional make and new functions without actually having
a seperate structure.

The prob value can be used now as codec as well, that can only encode
one bit. This helps to write consistent code.