Issue 4009: Fix predicate detection in simplify_logic.

Previously, simplify_logic would assume all free symbols were predicates, and
would construct a truth table based on results of substituting True/False for
each.  This would sometimes result in incorrect simplifications when Boolean
structures were made containing other expressions.  Now, it takes anything
that is not a BooleanFunction as a predicate, then simplifies the predicates
before reassembling.