Allow transformer/resourceKey to come from data.

When initializing a resource, the transformer and resourceKey can be automatically provided by the following methods on $data:

* $data->getTransformer()
* $data->getResourceKey()