When saving an entity, allow $id to be set to ent.id

See #11
This allows `$id` to be set to `ent.id` if `ent.$id` and `ent._id` are undefined.