some attempts at optimization

avoid duplicates in permutations and subsets, use the same BiExpr object if possible
countdown: more removing of duplicates