Clean up duplicated change-building code in objects

Almost every object thus far has done this:

  updates = {}
  changes = self.obj_what_changed()
  for field in changes:
        updates[field] = self[field]

to get a dict of updates to apply to the database. This patch adds
that as part of the base object and makes every place that does
the above to just use that.

It's a port from a patch in nova ,link to the origional patch:
https://review.openstack.org/#/c/45353/

Change-Id: I8d2616ecc2c88cf4b21e7e8193f5b985407ed869
Closes-Bug: #1259527
Rework patch validation on Ports

This makes use of the complex type objects of WSME and creates a type
to validate json patch format.

Change-Id: I17ea33efec16146d4ece90fd0ef5123faaacefb0
Partial-Bug: #1223847
Merge "Clean up duplicated change-building code in objects"