Implement "reexported-modules" field, towards fixing GHC bug #8407.

Re-exported modules allow packages to reexport modules from their
dependencies without having to create stub files.  Reexports of the same
original module don't count as ambiguous imports when module finding
occurs.  The syntax is:

    "orig-pkg" OrigName as NewName

You can omit 'as NewName', in which case it is reexported as the same
name.  Self referential aliases work too; however, they're only visible
to packages which depend on this package.

Left to future work: just provide a module name 'OrigName', where ghc-pkg
figures out what the source package is.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Draft of extending PackageId to include version dep info (#9265)

New internal format for package ID is pkg-1.0@abcdef1234567890.
The hash is computed using:

    mkExtra :: [PackageIdentifier] -> PackageExtra
    mkExtra pids = PackageExtra . show . fingerprintString . show . sort $ pids

ToDo: The dependency chain of the current Cabal is not reported accurately.
But maybe that's OK, because this appears to only be used for version
reporting.  In that case, get rid of the cabalExtra param.

ToDo: What are package version macros, and do they need the extra info?

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>