Moved getRandomInt function to common.js.