Quick-union improvements I (JS).
Quick-union improvements II (JS).