Add type conversion nodes to the IR.

Change-Id: I5a5a69ccd2e2f2f3c9f8592c4b04455d6a567e83
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Clean-up the linearize function.

Change-Id: I75982638dd90ceb776064b3cd0153b96523a70e1
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>