First cut at implementation of dense_rank.