(#18508) Extract class to control generating resources

The logic for determining how to add generated resources into the
catalog was tightly bound with the rest of the transaction code. This
makes it hard to test the exact logic around that. By extracting a class
it exposes that logic in a much more testable form.
(#18508) Ensure eval_generated resources apply at the right time

Resources created with eval_generate need to apply with the same
priority as their parent resource.
(#18508) Handle duplicate generated resources correctly

When a generated resource duplicates a resource already in the catalog,
we want to avoid adding it a second time, but we still want to create
dependencies between the resource and the generating resource. For
example, we may have a recursive file resource, but explicitly model one
of the files that will be generated. We still want the explicit file
resource to depend on its generated parent directory.

This also refactors the resource generation methods, splitting them up
into smaller methods.
(#18508) Ensure that no two resources have the same priority

The underlying red-black tree that is used as the priority queue for
tracking what resources to evaluate will only allow a single value per
key. This means that when generated resources are added they need to get
unique priority keys. However there could be an arbitrary number of
these resources added in between existing resources. This commit
provides a Puppet::Graph::Key that behaves like the numbering scheme of
an outline so that priorities can be arbitrarily nested and the nested
priorities are between the priorities at the outer level.

The integration tests for the file type caught this error. It only
showed up when 2 unique, new resources are generated.
(Maint) Move most graph related code to Puppet::Graph

We often talk about "the graph", but until now there hasn't been a clear
graph that we were talking about. The relationship graph that is used
for evaluation is the best candidate to fill this role, since it
contains all of the ordering information that is needed.

This also removes Puppet::Util::Graph, which was unused.
Merge pull request #1838 from zaphod42/feature/master/18508-handle-generated-resources-on-agent

(#18508) Ensure eval_generated resources apply at the right time