The predicate execution context now includes the entity containing the clause under execution

This change allows a number of long standing issues to be fixed, some of them in this commit and some in follow up commits.