A buncha implementation
Implementation of most of the resampling machinery