Added 'Sample.rank', which computes ranks for a given array