Messing with trie data structures in python.