All scripts have an environment called "env", environments are linked to the parent environment. this is a variable that can be used to access any environment variable as defined by the parent process.
When setting something on env it's stored on the current envirnment. Reading first checks the current one, then the parent ones until it finds one (or returns undefined).
Each script has it's own work directory, stored in the global "wd" property. All file operations are relative to the work directory, when a path starts with "~/" it's resolved to the user home dir. On Windows / is replaced with \ when used.
All arguments are automatically expanded, it turns $(Test) into the local or environment value Test, if 'Test' is not available in the scope and environment it leaves it as-is, use $$ when you want $.