Nonparametric Divergence Estimation with Applications to Machine Learning on Distributions