Now i remember why i ended in the addon solution. The tool shelf code in the node editor is a can of worms -.-
And this means i cannot even promise to touch this area. We might end in the addon solution again. But i will continue with some more experiments.