(Start to) rewrite and genericize talents factory using "nodes"

Woah, I have no idea what I am doing here.
And nothing is tested, probably got some basic stuff wrong.
But it was all a very good mental exercise and thought experiment!
There'll probably be a second attempt to rewrite this, when I've found some nice clean-looking code I can pattern it all after.