Add DecoderTest, start to move all decoding logic to Decoder