Support function coercions

Support function coercions.
Make identity coercions more efficient.