other commit
Removed sorted queries stuff
Added pretty printing
Fixed traversal in query_tree(). Fixed sorting in build_tree(). Added gzopen.