Improve performance of UsageTable.contains.
Remove unnecessary use of patNameSet.
Make UsageTable.without faster.
Improve performance of simplification engine slightly via caching.

Specifically, we now cache the queries for free names in expressions.