Non-parametric goodness-of-fit testing and applications