Update from Blender code.
Add UID helpers, 'Documents' element generator, and some minor improvements

UID helpers is mostly a singleton containing to dicts to map keys <-> uids. Experimental code, do not have much experience in UIDs...