Support env file

Replaces #481 and #479 addressing the issues raised in those tickets.
I wonder if we could support the normal use case where it isn't an array? Should just be an `isinstance(..., list)` right?