Moved the random op generation functions so they can be used in sharejs