make AnalyseDeclarationsTransform inherit from EnvTransform to fix inconsistencies in scope tracking