Use more Datums in trans.

Datums are safer than plain ValueRefs, as they hold a type and a kind (specifying how the value should be handled), and potentially more efficient (e.g. repeated type lookups can be expensive, because of substitutions).
This PR begins the conversion of old code using ValueRefs to Datums.
It also introduces a new Datum kind, PodValue, which can be freely shared, akin to an Lvalue.