Cleanup: Replace ResolveRepositoryName with RepositoryInfo{}

#  Reason for cleanup

Currently, we breakdown a repository name using a combination of ResolveRepositoryName, and NewEndpoint as follows:

```
  debian
  \____/
     |
  repoName  =>  ResolveRepositoryName()
                      |
               ______/ \_____________________
              /                              \
  https://index.docker.io/v1/              debian
  \_________________________/              \____/
        |                                     |
     hostname  =>  NewEndpoint()          remoteName
                       |                      |
                    endpoint              ___/\______
                       |                 /           \
 https://index.docker.io/v1/      library/debian    debian
 \______/\_____________/\__/      \____________/     \___/
     |          |         |              |             |
 URL.Scheme  URL.Host  Version      remoteName~    localName



  127.0.0.1:5000/myapp _________________________________
  \__________________/                                  \
     |                                                  |
  repoName  => ResolveRepositoryName()                  |
                      |                                 |
               ______/ \______________________          |
              /                               \         |
       127.0.0.1:5000                       myapp       |
       \____________/                       \____/      |
         |                                    |         |
     hostname  =>  NewEndpoint()              |         |
                       |                      |         |
      GET https://127.0.0.1:5000/v1/_ping     |         |
                       |                      |         |
                       x (Error)              |         |
                       |                      |         |
      GET http://127.0.0.1:5000/v1/_ping      |         |
                       |                      |         |
                    endpoint                  |         |
                       |                      |         |
 http://127.0.0.1:5000/v1/                    |         |
 \_____/\____________/\__/                    |         |
     |        |         |                     |         |
 URL.Scheme  URL.Host  Version          remoteName  localName
```

However, policies around whether or not repository is using the 'official index' or an 'official repository' are sprinkled throughout the code.  Also, rules regarding remoteName for the official repositories ('library/ prefix'), localName, which mirrors to use, etc, are also sprinkled throughout the code.   

This results in awkward follow-up checks against repository names, such as
```
if len(strings.SplitN(name, "/", 2)) == 1 { ... "You cannot push a \"root\" repository." ...}
```
```
if endpoint.VersionString(1) == registry.IndexServerAddress() { ... [clean up names and set up mirrors] ... }
```

Having to track down these pieces of logic throughout the code makes modifications to repository name parsing fragile, and hard to test.

# Refactors made

## ResolveRepositoryName(repoName) deprecated.  
Replaced with the following:
* ValidateRepositoryName(repoName) 
  * Used when a RepositoryInfo breakdown is not needed, just a validation check.
* ParseRepositoryInfo(repoName)
  * Used when RegistryServiceConfig is not available, and just performs the breakdown (above)
* NormalizeLocalName
  * Transforms a name for use as a key into TagStore.Repositories.
  * Used to avoid multiple official image names referring to the same image (e.g. 'library/debian' vs 'debian')
* ResolveRepositoryInfo
  * Calls a Job("resolve_repository") to fully resolve a repository name into a RepositoryInfo
  * Result includes index info.
* ResolveIndexInfo
  * Calls a Job("resolve_index") to resolve an index name into an IndexInfo
  * Result includes repository configuration (for now, only Mirrors are defined).

## RepositoryInfo

```
type IndexInfo struct {
        Name       string   `json:"name"`
        Mirrors    []string `json:"mirrors"`
        IsSecure   bool     `json:"is_secure"`
        IsOfficial bool     `json:"is_official"`
}

type RepositoryInfo struct {
        Index         *IndexInfo `json:"index"`
        RemoteName    string     `json:"remote_name"`
        LocalName     string     `json:"local_name"`
        CanonicalName string     `json:"canonical_name"`
        IsOfficial    bool       `json:"is_official"`
}
```

Returned by ParseRepositoryInfo, or ResolveRepositoryInfo.  
* Index.Name: Replaces 'hostname'. 
  * Examples: 'docker.io' (official), '127.0.0.1:8000' (private)
* Index.Mirrors: List of mirrors for use in a pull.
  * Only configurable for official index, currently.
* Index.IsSecure: 
  * True for official index
  * Value for private index depends on --insecure-registry flag
* Index.IsOfficial: Whether or not repository refers to the official docker.io index.
* RemoteName: Remote repository name
  * Examples: 'library/debian', 'user/repo'
  * Policies for official repo names are resolved.
* LocalName: Name to use in TagStore.Repositories
  * Examples: 'debian', '127.0.0.1:8000/user/repo'
  * Policies for official vs private repo names are resolved.
* CanonicalName: 'global' name of repository.
  * Displayed to the user in information messages, e.g.: "Pulling image from <CanonicalName>"
  * For now, the CanonicalName matches LocalName rules. 
* IsOfficial: Whether or not repository refers to a library repository on the official docker.io index.






NEEDSREVIEW: Test updated to new IndexInfo/RepositoryInfo structure