Core Change: Multi-repository support

This is an evolution of pull request #6086 which presented an external command called `brew-tap` that makes it easier for Homebrew users to access formulae from alternate repositories. Refer to that pull request for the development history behind the patches presented here.

This pull request distils `brew-tap` into five patches that integrate into the Homebrew core without causing too much disruption or requiring massive re-writes. Multi-repository support is still under discussion and I expect these patches will evolve or be supplanted by an alternate implementation before we settle on a solution.

## Summary of Core Chages

- A new file, `Library/Homebrew/taproom.rb`, has been added that contains the implementation for two new classes: `Brewery` and `Taproom`. `Brewery` is a class that represents a GitHub repository and can be used to retrieve information from the GitHub API. `Taproom` is a class that manages a folder where Git repositories may be cloned and aids in the discovery of brew files contained in those repositories. Together these classes form the core of multi-repository support.

- A new Homebrew command: `Library/Homebrew/cmd/tap.rb`. Compared to the `brew-tap` command presented in pull request #6086, this version is focused on managing external repositories using three sub-commands: `list`, `add` and `remove`. The repositories available for cloning through `brew-tap` are defined to be Adam's [Homebrew-alt repository](https://github.com/adamv/homebrew-alt) and anything in its [fork network](https://github.com/adamv/homebrew-alt/network). This constraint arises from the use of a global variable, `HOMEBREW_TAPROOM`, which is an object of class `Taproom` initiated from a `Brewery` object that represents Adam's repository. See comments in `Library/Formula/Homebrew/taproom.rb` for reasoning behind restricting te available repositories to the Homebrew-alt network---at least at first.

- The `canonical_name` method of the `Formula` class is extended such that it can discover brew files using the `HOMEBREW_TAPROOM`. This simple change makes formulae in tapped repositories available to `Formula.factory` and commands like `install`, `uninstall`, `info` and `home`.

- The `update` command is where the largest re-write occurred---but nothing much was changed. The `RefreshBrew` class gained some arguments to its initializer that allows it to update arbitrary repositories. The update code that is specific to the structure of the master repository was moved into a new subclass called `RefreshCore`.

- External dependency resolution was implemented through the addition of an `:alt` keyword to `depends_on`. `Formula.expand_deps` can now find dependencies flagged as `:alt` by querying `HOMEBREW_TAPROOM`.


## Design Issues

- The `Brewery` class currently uses the [httparty gem](http://rubygems.org/gems/httparty) to communicate with the GitHub API and de-serialize JSON data to Ruby objects. The communication could be done through system calls to `curl`, but we still need to figure out how to deal with the JSON. Some possibilities:

  - Keep the gem dependency and add a `gem install httparty` to the Homebrew install script.

  - Bundle a copy of HTTParty or some other JSON parser into the main Homebrew repository.

  - Maintain our own JSON parsing code and use `curl` for communication.

- Easy acces to alternate repositories will allow users to get easily around Homebrew rules such as "no duplicates". I think this is a good thing as it allows consenting adults to build whatever they want the exact way they want it. However, we should build in a system that flags alternate installs in a way that `brew doctor` can easily detect so that bug reports stay manageable.

## Remaining Work

- Tests related to multi-repository support need to be written. Currently there are four failing tests in the Homebrew testsuite due to changes in `brew update` ~~and one failing test due to the use of a global variable, `HOMEBREW_TAPROOM`, in `formula.rb`~~.

- Some commands such as `brew edit` and things like bash completion need to be tweaked so that they pick up formulae in external repositories.

- Material from the old `brew-tap` [manpage](https://raw.github.com/Sharpie/homebrew/brew-tap/Library/Contributions/manpages/brew-tap.1.md) needs to be merged into the `brew` manpage.

Of course, design work is ongoing so comments and suggestions are greatly appreciated!