Layering & ownership notes
--------------------------

META_AV may or may not own av->p, depending on (av->flags & AV_FREE_P)
VM does not own vm->head/tail[VM_REQ/REP] 
JOB does own job->vm->head/tail[VM_REQ/REP] 
IFACE owns its send queue and channels
CHAN does not own its subprocess but does own the reply list it's receiving
CONF owns its sources, interfaces and subprocesses; also the behaviour 
expression and the dictionary.

==

proc_* may not use proc->chan or call any chan_* routine; that's a layering
violation. When a subprocess event occurs, the event dispatcher (main) must 
call proc_handle_* and then chan_handle_* if neccessary.

chan_* does not deal with interfaces other than with their data members in so
far as they are parameters for channels; it handles jobs directly.

job_toiface, job_tochan and job_fromchan deal with channels directly. There
is no real interface layer other than some parameters and a shared job queue.

In other words, chan_* and job_* may freely call each other.

==

* meta_decode and meta_*msgtoav create new META_AVs on the heap and return 
  them in a list.
* meta_buildtree removes the META_AVs it can use from the supplied list
  and moves them to the returned tree. It may also create new (encapsulating)
  META_AVs on the heap which are present in the returned tree.
* meta_encode does not free anything, nor does meta_avtomsg
* meta_freeavlist can be used to free a whole tree.
