moved common parts of db ActiveRelation and Query to traits

these parts can be reused in other ActiveRecord implementations
add relationClassName to AR to allow different relation classes

... for different dbms
fixed conflicting property declaration
renamed AR trait classes
Merge branch 'master' into db-traits

Updated AR classes with the latest changes from master to go on with
separation of AR query classes in traits.

Conflicts:
	framework/yii/db/ActiveQuery.php
	framework/yii/db/ActiveRecord.php
	framework/yii/db/ActiveRelation.php
refactored ActiveRecord classes to use Interfaces and traits

this allows us to implement other activerecord implementations based on
NoSQL dbms
added unit tests for active dataprovider and fixed query tests
dataprovider: reset orderBy when counting

strict sql dbms like postgres would fail otherwise
updated interface and trait php-doc in yii\ar

[ci skip]
moved indexBy() trait -> interface + removed findWith from interface
reverted change of count() signature
Merge pull request #1097 from yiisoft/db-traits

Db traits