wrap env variables in '{' and '}'
Apply substitutions globally on lines
moved some behaviour options to seperated folds