Fix clamped ramps bug.

It was failing when the clamped load happened in a let expr.
libc++ doesn't like stateful comparison objects

Fixed by associating the cache with the Exprs being compared, rather than
the comparison object. Yuck, but the other option was a global cache.
Fixed problems with untyped enum and templates.
Merge branch 'master' into trunc
Document algorithm for custom round function