Move Decoder and Encoder inside the AbstractMessage class.