Added templated disjoint set class with tests