Exception handling for controllers using ActionController::Live

Any exceptions that occured at the view or controller level for a
controller using ActionController::Live would cause the server to either
hang with an open socket indefinitely, or immediately crash (depending
on whether the server was launched with rails s or directly). Changed
the behavior of exceptions to act the same as streaming templates for
html requests, and allow for an on_error callback if needed.
Add TEST_DIRS enviroment for constrain test directories in rakefile
Merge pull request #9604 from sgrif/live_streaming_exceptions

Exceptions raised when using ActionController::Live cause server crash
Grouping thread locals in the ActiveRecord scopes so that the
current_scope and ignore_default_scope locals are brought together under
a registry object.
Merge pull request #10135 from wangjohn/grouping_thread_locals

Grouping thread locals in the ActiveRecord scopes
Delegating the value getter and setters in the ScopeRegistry to the
current ScopeRegister object.
Mark unused variables and make some style fixes

It'd be a nice convention to mark the unused variables like this, now that Ruby 2 will issue no warnings for such vars being unused.
Merge pull request #10143 from Agis-/mark_unused_vars

Mark unused variables and make some style fixes
Creating an object to consolidate thread locals which hold the
instrumenters for the AS::Notifications module.
Merge pull request #10145 from wangjohn/instrumentation_registry_creation

Consolidating thread locals in AS::Notifications
fix AP warning; remove unused variable
Merge pull request #10147 from vipulnsward/fix_AP_live_warning

fix AP warning; remove unused variable
change array of array to hash
Merge pull request #10148 from vipulnsward/traces_change

change array of array to hash
Merge pull request #10138 from hbakhtiyor/test-dirs-environment

Add TEST_DIRS enviroment for constrain test directories in rakefile
changed variable name active_record => base_klass

Current code stores the klass name in active_record and this
is used throughout. While reviewing the code time and again
I had the mental picture of active_record being an instance of
a klass. However here the actual klass is being stored in
@active_record.

Secondly at two different places while referring to @active_record
the comment refers to it as base klass. All this points to
active_record being not the best variable name.

So I thought it is better to replace active_record with base_klass.

This change is confined to JoinDependency, JoinBase, JoinPart and
JoinAssociation - all joining related work.
Merge pull request #10151 from neerajdotname/ar-to-klass

changed variable name active_record => base_klass
Merge pull request #10142 from wangjohn/grouping_thread_locals

Delegating the value getter and setters in the ScopeRegistry