pure Python version NodeAllocator
code clean up
change trie structure
rewrite a tree traversal code without using recursion.
code clean up