Implement quick union.

* Also generalize test so we can assign which class to use in test-command.