[BUILD] Randomization script refactoring

1) Refactored randomization logic to the top
2) Add logics to support window platforms
`(ENV['BUILD_ID'] + ENV['BUILD_NUMBER']) rescue 'prop'` seems enough, since the `||` won't ever be evaluated?, it'll always explode on `can't convert nil into String` when the ENV vars are not set?