A basic implementation of the context tree weighing compression algorithm for a binary source.
reference:
Handbook of data compression, ch 5, by david salomon.
Volf, P. A. J. (2002). Weighting techniques in data compression.
https://www.cbloom.com/algs/statisti.html#A1.0