Adding random repetition support.

If the repetition value is an array, the repetition will be a random number within
that range.