Added Collection::map()

- Created method Collection::map()
- Modified Collection::each() to use Collection::map() to prevent duplicate code