Support flat_map

flat_map is over 40% faster for small arrays (see benchmarks), but is
not available in Ruby-1.8.7. This commit adds an implementation for
1.8.7 with a pass-through for >= 1.9.

Hat tip to Myron Marston for the implementation that does not monkey
patch nor extend runtime objects, and supports blocks without converting
them to Procs.