Initialisation fix: cope with unrecognised binary operator.

If EvalClassExpression() got a Constraint whose ->lval wasn't one of
the known operations, it would have fallen through to the and/or/xor
and used an uninitialized value for logic, with potentially random
results.  If we were *lucky* it'd use an invalid value for it and
(after wasting a lot of time running round a loop computing values it
would subsequently not use) return false, like it should; but only if
we were lucky.
Break up EvalClassExpression() and fix some infelicities.

It was getting a bit long; and there were some minor glitches.
Also moved ValidClassName from bottom to top of the file.
Pass correct buffer size to snprintf().
Skip needless casts from void*.
Make variables more local.

The check for "anything after this wants a list" was after the
handling of select_class - which wants a list - so swapped their
order.  Broke out class selection, both deterministic and random,
into functions of their own - and made each a bit more robust.

The warning fix in the last commit could be better fixed by moving the
bool-combination code into a separate function; where it could be
simplified a bit, too.  Downside: the previously local enum is now at
file scope.
Merge pull request #1997 from ediosyncratic/class-expr-cleanup

Class expression cleanup