Collection: replace array_map with foreach to preserve source array keys.

When passing 2 arguments to array_map (done by Illuminate\Support\Collection)
the array keys are not preserved. For the counts functionality this is required.

@see http://www.php.net/manual/en/function.array-map.php#example-5055