Functional (non-assignment) part of compact linear type recoding.

Assignment to projections doesn't work yet. Code isn't optimised.
Old code will eventually be removed.