move XORShiftRandom to util.random and use it in BernoulliSampler