Added random functionality

Change-Id: If79c6b5843ca649cca3a5bbf39643fb7b6aaf11a
Reviewed-on: http://review.couchbase.org/32352
Tested-by: Trond Norbye <trond.norbye@gmail.com>
Reviewed-by: Chiyoung Seo <chiyoung@couchbase.com>