refined compile.ml, but the environment stuff will probably be moved to sast.ml