Better environment variable parsing

This is a backwards incompatible change that improves environment variable parsing, but moves it to backwards incompatible variable names.