Improve metadata update operations
Currently our metadata operations in the DB and the API are less than
optimal, main issues are:
- To update metadata first we get all metadata in the API and add
requested update metadata, then on the DB we retrieve each of the
metadata keys and update one by one contents.
- When deletion of existing keys is requested in the DB we retrieve all
metadata contents and for those that are not in the new metadata we
retrieve the contents from the DB (again) and delete the entry.
This patch changes this so we no longer retrieve metadata in the API,
deletion does not retrieve any metadata from the DB and just makes 1
deletion request to the DB, and for changes we retrieve metadata once
and then issue a bulk change to create new entries and update existing
ones.
Partial-Bug: #
1238093
Change-Id: I12506541cca61282122e319e3504560f68df225b