in flattenStacks, use a set to test belonging of ordinal Xs

the previous solution in PR #251 was still using relational
operators to test whether points' x coordinates were in the domain

this is not correct for ordinal coordinates, which don't have to be
ordered by the key (the domain specifies the order, the
relational operators do not)