The outliner tree element creation function passed a `void *idv`
argument and did weird and hard to follow stuff with it (like casting it
to `ID *` even though it wouldn't point to an ID, and further overriding
it based on the element type). This change tries to untangle this, so
that it's easy to follow what's going on, and so that a bunch of casts
from non-ID data to ID pointers are removed.
Basically the void pointer is split into an ID pointer for the owning ID
(if any) and a void pointer for custom data for the element creation.
This can be made type safe still, but that's for another commit. It also
allows us to remove some wrapper structs. The element creation function
itself no longer needs to know what kind of data is passed via the void
pointer. So this change has a number of benefits in fact.
Also improves/adds related comments.
Was quite careful to not cause behavioral changes.