Refactored TreeServices and added local top-trees support (issue #10)