generalize ensemble splitting

- move the ensemble splitting from the user to the system
- clean up some of the generalized code and the datastructures used