Update: Make addition/removal of resources more explicit

Use add_resource() and remove_resource() functions instead of indexing to
add and remove resources, to make it less surprising that the resources
themselves are being modified in the process.

Change-Id: I392cca8f68165988842affd1e23bce958645921b
Merge "Update: Make addition/removal of resources more explicit"