lapply_names function

Applies function only to named elements of a list.