Avoid duplication of environment variables (for Yosemite)

(Maybe overkill, but gives a place to start)

This works around duplicate environment variable issues (specifically `PATH`) on OS X. This ensures that, when setting an environment variable, all environment variables with that name are removed and then the new one is set.