I'm no longer calling ``np.unique`` so the labels are no longer just integers, and collecting the like class indices is the bottleneck. I tried cython and the equivalent versions are slower than ``_collect_indices`` or ``_histogram``. The algorithm I went with is to partition all the indices by class and pass them and the class counts to the sampling functions at the bottom. If this is the wrong one I can fix it, and this is as fast as I can make it right now.

In the initial PR, sampling was slow for cases with large numbers of unique classes since I was doing an ndarray index N times. I tried 1 million classes (who would have this?) and I had to ctrl-c it after several minutes. This way it's 1s for 1mil classes and .38s for 10 classes for 1mil datapoints. I don't know how to speed it up further.