activerecord as array

implementation of asArray as discussed in #531.
Allows returning arrays as result of all find methods and relations with `getRelated()`.

Implementation introduces a scope-like method named `asArray` which can be used as follows:

```php
<?php
    $post=Post::model()->asArray()->findByPk(1);
    $posts=Post::model()->asArray()->findAll();
    // This also works for relations (asuming <code>author</code> and <code>categories</code> are relations):
    $author=$post->asArray()->author;
    $categories=$post->asArray()->categories;
```

It will work for all find Methods, so I touched `CActiveRecord::query()`, `CActiveRecord::findBySql()` and `CActiveRecord::findAllBySql()`.
Also fixed scope resetting (`$this->_c=null`) in findBySql which did not work properly.

### adjustments to getRelated() [diff](https://github.com/yiisoft/yii/pull/819/files#L1L240)

`getRelated()` will return array result, when scope `asArray` is true by using asArray implementation of activeFinder.
The `$this->_related` cache is not touched in case of `asArray`.

### adjustments to query() [diff](https://github.com/yiisoft/yii/pull/819/files#L1L1288)

query will use the result of `$command->queryAll()`/`$command->queryRow()` to provide asArray functionallity. It will consider `$criteria->index` just like `populateRecords()` does.
If criteria has a `with` option set, it will use CActiveFinders asArray implementation.

### asArray in CActiveFinder [diff](https://github.com/yiisoft/yii/pull/819/files#L0R26)

CActiveFinder will use a new class `CActiveRecordArray` ([see code in diff](https://github.com/yiisoft/yii/pull/819/files#L0L1646)) which provides the same interface as CActiveRecord does for adding related records, getting primary key and getting attributes, so the changes to code of CActiveFinder can be reduced to a minimum. This class is necessary because `CJoinElement::populateRecord()` works on the objects by reference to attach related records. This is not possible with arrays, so I had to take the overhead of this class into to make it possible without having to change the whole implementation. As shown in a [comment below](#issuecomment-6411764) this is not as good as pure array but much better than using CActiveRecord itself.
All places that create records now have to check if `asArray` is true and create `CActiveRecordArray` instead of `CActiveRecord` and all places where result is returned will use `CActiveRecordArray::toArray()` to return array result.
So `CActiveRecordArray` is only used internally by CActiveFinder and never comes to the outside (I am checking this in all of the tests).