Implementation of the tree command