Re-org some environment variables and code.  Add some new comments.