NamedGraph, attempt #2

See if this refactoring is a better fit for everyone.
This works for my use case, but there is still the question of what to do if renaming causes nodes/edges to merge. Currently I simply use the union of :adj and :in sets of the two merging nodes. A more general approach might be of interest. Some test.check of different rename-nodes implementations added, as well.

I synced my fork, so it should be an easy merge. Let me know what you think.