Improved macqiime environment variable sourcing

Also changed a few clean-up operations