Add reduce function to Collection

Also added a test for Collection::map()