Work towards getting environment variable support.
Merged conflicts.
Additional cleanup and merging.