Add Array#element_counts

Change Array#duplicates to leverage #element_counts