Added a util function to extract the fields from a dictionary that are included in a resource.
- Include tests