Clean up the code structure:
 1. pull get_credentials functions (from IAM role or local config file)
    out of S3Repository class
 2. pre-check the credentials in init_hook first to detect the s3 repo valid or not
 3. remove the incorrect s3 repos in init_hook to avoid the annoying error messages
    when other repos still can work
 4. add retry solution to fetch the credentials in IAM role under AWS metadata store
 5. add the log in the debug level "3" (CLI option "-v" can show these log messages)
 6. use a tricky solution to copy the elements of the existing repo to the new created s3 repo
 7. add "timeout", "retries", "server" in the section "Metadata" for the config file
    "/etc/s3yum.cfg"
 8. avoid directly exiting from yum when other repos still can work
 9. some tiny code cleanup