averageTree function

Compute an average tree from a set of trees and related operations