Add `--freeze-dependencies` option to install
Revert "Add `--freeze-dependencies` option to install"

This reverts commit a7794ded83a0977d2336e60fa4aed81e9bc64ca5.
Revert "Disable configuration time writing of `cabal.config`"

This reverts commit 2f6dbd338ac283d15866437d135b550fcc20dbad.
Revert "Installing overwrites cabal.config with constraints"

This reverts commit ec2565c2bbcf553681ed9f5cd29acb4364f1fb5d.
Revert "Configure overwrites cabal.config with constraints"

This reverts commit c12e6c22bc092cc425f37c55a9cb5d0c3929a16e.
Top-level `freeze` command freezes dependency versions

Add new top-level `freeze` command, which resolves the dependencies to exact
versions and writes a `constraints` section to `cabal.config`. This causes
future builds to use the same fully constrained dependencies.

The command takes a number of options related to resolving dependencies,
namely, `--solver`, `--max-backjumps`, `reorder-goals` and
`--shadow-installed-packages`. These are used to create an `InstallPlan` in
much the same way that `install` does so. The `InstallPlan` is converted to a
list and all `PlanPackage`s are inspected to determine their exact version.
These versions are then either written to `cabal.config` or to standard output
depending on the presence of `--dry-run`.

Limitations in resolving dependencies
-------------------------------------

In order to keep the initial implementation of this new command simpler, a
number of options are not yet supported.  There should be no great difficulty
in supporting the options `--flags`, `--enable-{tests,benchmarks}`,
`--constraint` and `--preference`.  However, the options concerned with
compilers may prove more difficult.

Different versions of GHC ship with different library versions, the
constraints that are written currently include all dependencies, including
`base`. This prevents the constraints, as written, from being used with
alternate versions of GHC.

There are three solutions to this problem: 1) have the user edit the
constraints section, 2) exclude certain packages from the list of constraints,
3) develop a mechanism for per-arch-os-compiler constraining. As neither (2)
nor (3) have been developed we default to (1).

The lack of a good story for per-compiler constraints has lead to the options
`--with-compiler`, `--ghc`, `--uhc` et al, not being supported.

Further limitations:
--------------------

 - The `cabal.config` file path is hardcoded.
 - The `cabal.config` file is completely overwritten. Just the `constraints`
   section should be overwritten.