Added command line arguments. Modified tree class to allow printing to console or writing to file.