commiting JavaScript version of UnionFind