Fix/transforms

More steps to make RefChecks work (an initial version is included in commit, this compiles, but does not run).

Main changes are to TreeTransforms. In particular TreeTransforms and phases are now disentangled. 

The last commit makes modules lazy and disables LazyVals. 

This PR depends on #161. #161 should be reviewed and committed first.

Review by @DarkDimius.