Rewrite default ebuild phase setting code

Replace the ebuild phase setting code for EAPI 2 and newer with a
simpler approach; first set proper default_* functions, and call them
within the phase. Disallow calling default_* for other phase functions
than the one being run.
Support EAPI=6_pre1 for testing EAPI6 features
Add tentative support for EAPI6 --docdir and --htmldir

Pass --docdir and --htmldir to configure scripts that support it.
Add tentative support for EAPI6 get_libdir()

Add get_libdir() function to obtain the basename of libdir using
the same algorithm that econf uses.
Add tentative support for EAPI6 einstalldocs function

Add the einstalldocs function to conveniently install documentation
using the default patterns or DOCS and HTML_DOCS variables.
Add tentative support for EAPI6 eapply function

Add the eapply patch applying function.
Add tentative support for EAPI6 eapply_user function

Add support for the user patch applying function.
Enable tentative EAPI6 failglob in global scope

Enable failglob in global scope to catch unintended globbing attempts
including unescaped special uses of '*'.
Enable tentative support for EAPI6 profile-level directories

Enable the support for package.* and use.* directories on profile and
repository level.
Add tentative EAPI6 .txz unpack support

Support unpacking .txz-suffixed archives.
Add tentative EAPI6 absolute path support to unpack()

Add support for absolute paths in unpack(). Allow subdirectory-level
relative paths not to start with './'.
Add tentative EAPI6 nonfatal support to die()

Add support for die() to respect 'nonfatal' modifier if
'--respect-nonfatal' (or '-n') option is used. This allows eclasses
to create custom ebuild helpers that mimic built-in helper behavior.
Add tentative EAPI6 in_iuse() function

Add a function to query IUSE_EFFECTIVE for flags.
Add tentative EAPI6 phase functions