Added statement cache
Revert "Merge pull request #6226 from gnufied/master"

This reverts commit 9bf1a0db4acbbf9e8e6f707250269185224e7efe, reversing
changes made to fed97091b9546d369a240d10b184793d49247dd3.

Conflicts:
	activerecord/test/cases/transaction_callbacks_test.rb

Reason: This fix introduces another issue described at #8937, so we are
reverting it to restore the behavior of 3-2-stable.

We will fix both issues when we come out with a better solution
remove_duplicate_results! should be protected
rdoc for some of the methods in JoinDependency
converge three lines into one
Merge pull request #10168 from neerajdotname/simple_improvements

Simple improvements
Merge pull request #10152 from Noemj/statement_cache

Statement cache

Conflicts:
	activerecord/CHANGELOG.md