Decode bits bug

I started adding more asserts to the decoding tests and discovered that the decode_all_bits function didnt actually do what we wanted it to do :-)


Wooohooo  first win for the unit test framework and mock devices :-)