Revert "Changed structure of Trie + TrieNode classes."

This reverts commit c3ee66fa0f62ed6b430cdc1eaa029b5d1e784ac5.