Implement Array#count instead of falling back to Enumerable#count

This avoids iteration with #each if no arguments are given.
Merge pull request #3133 from jemc/array_count

Implement Array#count instead of falling back to Enumerable#count