Refactor in trie decoder.

- Broke decoding into multiple phases. The additional phases do nothing
until we get tests ready.