Implement simple range-coded variant of LZJB encoding.

Instead of using a fixed match flag bit / 2-byte match format, we do some
simple order 0 arithmetic encoding of the literals, match positions, and
match lengths.
Clear in/out buffers in command-line program, for clearer debugging.

It can be disconcerting to see garbage in the buffer when single-stepping
through the program at early stages.  Clear the buffer to make humans'
lives a little more explicable.
Catch (and fix) bugs leading to infinite recursion in the lzjb-style encoder.