Support multiple anonymous remotes and decide remoteconf based on identity,received certificates and other information. General code clean up.