Let user connect components with lines

Iterating through each component type to retrieve it feels a bit contrived, I think its a sign that we need to change the structure of the data served to the client side. Abstracting that looking up into a utility will help, thanks for doing that.