Create a new version of Lilo.source that takes a key function to create the required map of id->entity