Replace IUSE with something complete
Replace loop with cleaner sed
Swap epatch with "maintenance-free" sed statements

And eliminate the plperl sed as it doesn't actually do anything.
Modernize Ebuilds to Catch Up With Upstream

Upstream has fixed the regression tests (pg_regress) so that we no
longer need to apply any hacks to make it work within in the confines of
Portage. This allowed us to drop the 'test' use flag and Makefile hack
within the ebuild. It just works.

Added missing 'use server' tests in pkg_postinst(), src_test(), and
pkg_config(). Don't give next steps for the server unless the server was
built. Additionally, we can't test the server if we didn't build
it. Same for configuring it.

Added missing dependencies. For the live ebuild these were mostly
related to building the man pages and optional documentation.

We don't need to add "/usr/${LIBDIR}/postgresql-${SLOT}" to the includes
or libraries search path as they're not being built in a different
package.