Adds map function that uses user's mapper function.