handle multiple comparisons on variable in evalBoolFactory (+unit tests)

copied from python version...