Cookbook: random sort and sampling. Closes #68. Closes #59.