Refactor configuration handling.
Improve credential handling to read from env or ~/.composer/config.json.