COSMIT refactor partitioning cross-validation strategies

There was a lot of repeated code in cross validation `__iter__` methods.