Add Array#element_counts

Change Array#duplicates to leverage #counts