Queue utility class
added TermCursor and BFSWalker