This required a significant refactor to shellenv.sh. Some strange, and not yet fully understood behavior of add_to_path was uncovered in doing this refactoring. More investigation is needed.