Make the Resolver template cache threadsafe  - closes #6404

The Template cache in the Resolver can be accessed by multiple threads
similtaneously in multi-threaded environments. The cache is implemented
using a Hash, which isn't threadsafe in all VMs (notably JRuby).

This commit extracts the cache to a new Cache class and adds mutexes to
prevent concurrent access.
More granular locking of the Resolver template cache

In order to avoid holding a global lock when doing template
resolution, instead add individual locks on a per cache entry
basis. The global lock is now only used for manipulation of the main
cache data structure.
Merge pull request #6425 from pinetops/resolver_concurrency_fix

Resolver concurrency fix
Prevent concurrent compilation of templates - closes #6400

This addresses an issue where in multi-threaded environments
multiple threads can attempt to compile a template at the same time,
which occasionally causes particular templates to end up in a bad
state.

So, add synchronization such that only a single thread can attempt to
compile a template at one time.
Revert "Merge pull request #6425 from pinetops/resolver_concurrency_fix"

This reverts commit 254c04286c5916ae7f91eb6e173b312e7a74e364, reversing
changes made to 513a0525c24c2944630acfa465b22cd2f4601adf.
Make the Resolver template cache threadsafe  - closes #6404

The Template cache in the Resolver can be accessed by multiple threads
similtaneously in multi-threaded environments. The cache is implemented
using a Hash, which isn't threadsafe in all VMs (notably JRuby).

This commit extracts the cache to a new Cache class and adds mutexes to
prevent concurrent access.
More granular locking of the Resolver template cache

In order to avoid holding a global lock when doing template
resolution, instead add individual locks on a per cache entry
basis. The global lock is now only used for manipulation of the main
cache data structure.
Fix bug when Rails.application is defined but is nil. See #881
Add HTML5 input[type="color"] helper
Add several HTML5 input helpers

The input types added are:

- input[type="month"]

- input[type="week"]

- input[type="datetime"]

- input[type="datetime-local"]
Add instance_accessor option to class_attribute
Merge pull request #5156 from avakhov/class-attribute-instance-accessor

Add instance_accessor option to class_attribute
Refactor aggregation writer method

Only constantize class_name once.
Remove not used variables from connection poll test

These variables were issuing some "not used" warnings.
Fix AR preloader example
Restore the frozen state on rollback. Fixes #6417.

Currently, when saving a frozen record, an exception would be thrown
which causes a rollback. However, there is a bug in active record that
"defrost" the record as a side effect:

    >> t = Topic.new
    => #<Topic id: nil, ...>
    >> t.freeze
    => #<Topic id: nil, ...>
    >> t.save
    RuntimeError: can't modify a frozen Hash
    >> t.frozen?
    => false
    >> t.save
    => true

This patch fixes the bug by explictly restoring the frozen state on the
attributes Hash after every rollback.
Merge pull request #6429 from marcandre/fix_test_request

Fix bug when Rails.application is defined but is nil. See #881
using __method__ for the command method calls
Merge pull request #5125 from winston/log_exception_when_cache_read_fails

#read_entry in ActiveSupport::Cache::FileStore should log details of the exception when an exception is thrown
Merge pull request #6420 from chancancode/master_restore_frozen_state_on_rollback

Restore frozen state on rollback, fixes #6417