Backport Enumerable#count to Rubies < 1.8.7
We quite often mistakenly use Array#count, which is only available in
Rubies >= 1.8.7, when we mean Array#size or Array#length. Because this
causes so much trouble, it seems valuable to simply backport
Enumerable#count and provide the method.