Randomize option value according to option type

Split random functions to random_lib module and updated some
function names.

Signed-off-by: Hao Liu <hliu@redhat.com>