Playing around with trie (prefix trees). Started with code in Wikipedia for Tries in python, http://en.wikipedia.org/wiki/Trie#A_Python_version