This adds a loop with versions around the resource definitions allowing
for multiple versions of the dune package with the expected behaviour
of dependency forwarding to Dune modules.
Additionally, it avoids the code duplication of _get_needed_resources:
It modifies the resource list to include the transitive closure of
Dune module dependencies and then calls the original implementation.