lib: Enhanced DisjointSet data structure

It is now possible to retrieve the number of subsets in the partition by
using the 'number_of_subsets' property. It is useful for intsance when
one wants to know if the partition is a singleton, or if is trivial
(every element is alone in its subset).