Developing Phylogeny-Aware Machine Learning Methods With Applications In Statistical Genetics And Causal Representation Learning