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.
Merge branch 'master' of https://github.com/halide/Halide into typed-funcs
Fixed problems with untyped enum and templates.
Merge branch 'master' into typed-funcs
A few small cleanups.
Cleaned up comments on typed funcs.