A framework for cross-validated classification problems, with applications to differential variability and differential distribution testing