Split cabal-install into library and executable components.

Makes it possible to write unit tests for code under Distribution.Client.*.
Merge pull request #1162 from 23Skidoo/split-cabal-install

Split cabal-install into library and executable components.