config/environment: Added load_from_file() function

This commit merges much duplicate setup code for the environments of the
command line utilities.