Trie decoder, unit tests.