refactor(graphs.graph-builder) Moved generic functions (ready)

... to more appropriate locations.

This logic never belonged inside the graph-builder, and is also useful elsewhere.