d3.random tests (see issue #539)

#539 has been around for 2 years. It's about time someone got it done.

(closes #539  )