Corrected getRelated() - Added count() function to EMongoDocument - Completed version

As discussed, this is completed version.

And changed minor code on getRelated() function (EMongoModel).
Sometime I store foreign key as a string, but it refer to a primary key (MongoID object). Such as:
I have 2 model:
class Store extends EMongoDocument
{
    public $_id; //MongoID object
    ... 
}       
and 
class Price extends EMongoDocument
{
    ....
    public $re_store; //String object
    ... 
    function relations(){
        return array(
            'store' => array('one', 'Store', '_id', 'on' => 're_store'),
        );
    }
}    

In my case, your current getRelated() cannot work. My correction is: convert string object to  MongoID object, and of course, in this case only. Hope you can understand me.
P/S: I think I still need change count() function. :">