Fix afterFind() called twice with hasMany relationship

It occurs when a model and the children models are related to a same model.
For example, such as the following:

* User hasMany Comment
* User hasMany Article
* Article hasMany Comment
Fix different format of $results in afterFind

Refs #2529

As of this commit, we can get consistent format of $resutls in afterFind.
And we can keep backward compatibility if Model::$useConsistentAfterFind is set to false.
Made AuthComponent::mapActions() act as a getter refs #3331
Revert "Merge pull request #4405 from php-engineer/master-session-bugfix"

This reverts commit 5863adda424b3f0f513436176608ea376af1c294, reversing
changes made to 4c37cf6d4b9ed740ed157a8a5089c6b76914def4.

There was no real issue. The lack of session cookie in CLI makes writing
tests a bit tricky which caused the confusion. Refs #4405, #4451.
Start IntegrationTestCase.

Not much here, but getting something down is a start.
Update version number to 2.5.4
Start to flesh out IntegrationTestCase.

Start adding an integration test for IntegrationTestCase - how meta.
Remove dead code.

This code is no longer needed, it can be removed safely.
Very crude dispatch cycle is working now.

The code is pretty simple right now as it doesn't attempt any fancy
footwork around mocks or giving you ways to only get the just the view
without the layout. It is also not possible to get the view variables
just yet.

I've also added a stub response to smooth over any issues where someone
might try and send a response by accident or on purpose :)
Fix header manipulation.

Convert headers from the format humans expect to the format PHP uses
internally.
Implement assertResponseXX methods.

Add positive tests for assertResponseXX methods, the negative tests seem
less useful right now.
Add assertRedirect()
Update all @deprecated annotations

to adhere to the @deprecated <version> <description> format, where version and description are mandatory.
Fix typos and expand docs.
Add assertResponseContains() to IntegrationTestCase.
Add more assertion methods.
Add exception handling to IntegrationTestCase.

Rendering exceptions is part of the 'integration' aspect of integration
testing.
Add array cast for method_cache data.

Fixes #4186
Remove offset from cloned queries used in subquery loads.

Having an offset in a subquery causes SQL errors in MySQL. Also
include a test to ensure HAVING is not an issue.

Fixes #4465
Merge pull request #4223 from chinpei215/2.6-issue2529-fix

Fix different format of $results in afterFind