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

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