B.decoder now use only a ring buffer, added more tests.