Make map and reduce use callbacks properly