Added JS version of common random number generator, and copyright notice in c version