Added recursive lookup of value types.
Compute type tags and insert implicit casts for arithmetic operations.