Allow underscores in trusted hosts

Underscores are valid characters in domain names, so don't prohibit them in trustedHosts[].
Also the domain name should be validated before creating the list with an invalid entry.
Remove CacheFile cache from APC on write

If APC is enabled on the piwik server, cache files written by the CacheFile
class are stored in the opcode cache. This causes disk io problems when doing
things like loading weblogs into piwik with the import_logs.py script,
especially when running in --disable-bulk-tracking mode. In this scenario,
apache write IO quickly reaches 100% and slows the import to a crawl.
xhprof: Execute aclocal and autoconf only if Gentoo is used.
Refactor Login controller and auth to be more modular and easier to extend/override. Added extra method to Auth interface and documented Auth interface completely. Created new PasswordResetter class to contain password reset logic.
Use superuser access when changing user password in PasswordResetter.
Fixing Login UI Tests.
Fix AccessTest integration test.
moved previously hardcoded in template Settings menu element into proper Menu class
Merge pull request #6320 from sabl0r/gentoo2

xhprof: Execute aclocal and autoconf only if Gentoo is used.
Merge pull request #6315 from brownoxford/delete-cachefile-from-apc-on-write

Remove CacheFile cache from APC on write
refs #6296 maybe we can detect number of rows matched by the UPDATE query, by using Mysql client flags  in both Mysqli and PDO
Add breaking change for Auth interface changes.
Refactor Auth::initSession method into its own class (SessionInitializer) since the logic will be common to all authentication implementations. Includes tweak to docs of UsersManager API method and additional methods to Auth interface.
Fixing AccessTest.
Revert UsersManager API change since it breaks BC for API users of getTokenAuth.
Fixing LoginTest.
Merge pull request #6321 from piwik/login_controller_refactor

Refactor login controller; move auth logic to Auth class and password reset logic to new PasswordResetter class.
Fixing bug found by tests
Adding unit test to check that rowCount() really returns matched rows and not only affected/updated rows
Add extra docs for core/Auth.php and make sure Registry has docs generated for it.