Ish/envvar

Rebased against current master.