WIP refactor message decoding and test.