added simple test for lower and upper bounds computation of encode context
first go at encoder. Most probably there are bugs but it seems to work