AliEnv: modular cleanup of vars and functions