Improve poor security recommendation in docs

As reported in #9960, the current documentation recommends an insecure practice for
key generation from a password (a single round of SHA-256). The modified documentation
uses ActiveSupport::KeyGenerator to perform proper key stretching.
Moved the check for the rails test environment into rails/test_unit so that you
can select frameworks separately when running rake test.
Don't require having Rails.application to run database tasks
Merge pull request #10256 from wangjohn/moving_check_for_test_environment_into_rails_env

Moved the check for the rails test environment into rails.rb

Closes #10238
Remove code duplication
Merge pull request #10331 from neerajdotname/exec-migration-in-transaction

Remove code duplication
Fix a SystemStackError that occurs when using time zone aware attributes.

This fixes issue #10066
Added testcase for #10067 and a CHANGELOG entry about this change.
Use DatabaseTasks.fixtures_path instead of FIXTURES_PATH in db.rake

This will allow to set fixtures path in global config easier, it should
be not needed to use FIXTURES_PATH every time user wants to load
fixtures.
Add some documentation to ActiveRecord::Tasks::DatabaseTasks

This is a public class, which could be used directly in order to allow
easier database management. Now it also contains settings, which will be
used by databases.rake.
Don't require Rails.env in order to use AR::Tasks::DatabaseTasks
Move CHANGELOG entry for db.rake improvements to 4.0.0
Merge pull request #10330 from kennyj/fix_10067

Serialized column should not be wrapped twice. Fix #10067.
refactor number helper
Use env == 'development' instead of env.development?

It's simpler to assume that passed env is just a string without any
extensions, especially when DatabaseTasks are intended to be used also
without rails.
Merge branch 'active-record-standalone-improvements'
Merge pull request #10332 from vipulnsward/number_helper

refactor number helper
Move method used only in the test to the test code itself
Minor AR changelog review [ci skip]
Merge pull request #10333 from ikataitsev/move-test-method-to-tests

Move method used only in the test to the test code itself