Refactored random-word-gen.js and fixed a getRandomWord bug.