FactorGraph structure analysis

@ppletscher, @iglesias This is the first part, in which I implemented the basic data structure - disjoint set for structure analysis of a factor graph, which could be important for finding roots, and testing if it is connected, is tree etc.