Make two JavaScript files with common functions which can be used by many games:

Cards.js is a deck of 52 cards
Dice.js is a dice which can have as many sides as needed