newick-compliant names

Adding the function to generate newick-compliant names.

No feature changes; just putting the function in the more general ot-base code repo (currently only available to treemachine).

The idea is that any dependant resource could make use of this function (if desired).

Could you merge @chinchliff?