replace the cost of the tree-set merge with an array set

more than a few null-checks instead. may return a bitset, so that the
cost of skipping nulls is reduced.