Rework auth config loading and use of auth data for login/pull/push

Fixes login and auth to private registries and generally cleanup and improve the auth related code.