Refactoring; splitting files.
More informative tree printing.