Add obj_to_primitive() to recursively primitiveize objects

Occasionally we need to recursively process a NovaObject into a
representative dict or list. This patch adds a function to do that
recursively, accounting for nested objects and lists of objects.

Related to blueprint unified-object-model

Change-Id: I6adb84f9e5a0564ec4af14200e26e838b4a5bb6e
Merge "Add obj_to_primitive() to recursively primitiveize objects"