Export env variables separately to make diffs more sensible

- Also reorder some stuff for clarity