Add objects/utils.py copied from Ironic

This is a straight copy of utils.py from Ironic to support versioned
objects.

Change-Id: I9cb9b491373fa46630fc06428b06a515cda037d8