ENH improve rand_int and rand_uniform
Merge pull request #3397 from arjoly/tree-factor-rand

Improve random number generator helper in the tree module