Moved tree to listtree.

Added preliminary test case for loops.