Various fixes to the optimizer.

Mainly type inference and type propagation.

Also added constant/copy propagation pass, which is disabled for the
moment.

Change-Id: I286c1fbced0d175be76868e870ca92c0da88babd
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Add the constant condition evaluation optimization.

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