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. 

Review by @DarkDimius.