Fix ABI hash construction to exclude trailing newline
Change rep of module re-exports, and do resolution ourselves

The initial support for module re-exports relied on ghc-pkg to resolve
user-specified re-exports to references to specific installed packages.
This resolution is something that can fail so it's better for Cabal to
do it during the package configure phase.

In addition, it is inconvenient in ghc-pkg to be doing this resolution,
and it just seems fishy as a design. Also, the same ModuleExport type
was being used both for user-specified source re-exports and also for
the specific re-exports in the package db.

This patch splits the type into two: one for source level, and one for
resolved ones for use in the package db. The configure phase resolves
one to the other.

One minor change: it is now possible to re-export a module defined in
the same package that is not itself exported (ie it's in other-modules,
rather than exposed-modules). Previously for modules definied in the
same package they had to be themselves exported. Of course for
re-exports from other packages they have to be exposed.
Merge pull request #2061 from dcoutts/master

Change rep of module re-exports, and do module re-export resolution ourselves in Cabal