Added another version of canonical_branch_lengths that takes a tree object as input.