FIX: random number generator

FIX: address @larsmans + @ogrisel comments

ENH: add INT32_t type

ENH: rename INT32_t to UINT32_t

FIX: modulo RAND_R_MAX+1

FIX: broken tests