class Encode: sub classes for BCD, D1B, D2B, D2C added; test_decode added.