Add id_attribute and resource_name to resource

The resource had 'id' hard coded all over the place and this
caused problems if the key for the resource was not 'id'.
The id_attribute can be used to override that now.  The
resource_name can be used for printed errors and strings
associated with the resource rather than teh resource_key.

Change-Id: I66afa842b8315e24d1a2e0698983440bf97ae986
Merge "Add id_attribute and resource_name to resource"