Automatically detects deep-nested $kinvey objects and replace with references

This pull request addresses issue **#19: Automatically detect deep $kinvey objects and replace with references** and is documented [here](https://github.com/ninjatronic/angular-kinvey/wiki/Data-Store#automatic-referencing).

### $reference Method

To get the reference of a resource instance:

```javascript
var badger = new $kinvey.Badger({_id: 'myId'});
var reference = badger.$reference();
```

**NB:** $reference will return undefined if the Resource instance has no _id.

### Automatic Reference Replacement

During serialization for a saving operation, the library will detect any nested Resource instances inside the serializing model and replace them with references. This implementation (`flatten` method in the code) uses the `$reference` instance level method both as a marker and reference provider. 

```javascript
$kinvey.alias('badger', 'Badger');
var badger = new Badger({_id: 'badgerId'});
var user = new $kinvey.User({
    username: 'username',
    password: 'password',
    badger: badger
});
user.$signup();
```

In the above example, the user object would be serialized and sent to Kinvey as...

```json
{
    "username": "username",
    "password": "password",
    "badger": {
        "_type": "KinveyRef",
        "_collection": "badger",
        "_id:": "badgerId"
    }
}
```