chat-hook: implement group/permission migration
chat-hook: implement group/permission migration

We want to move from group/permission paths of the form /chat/~host/name
to /~/~host/name, merging the ./read and ./write permission paths into a
single permission matching the group path.
(The leading /~ signifies an "unmanaged" group, one used by apps
internally, and not explicitly exposed to the user as a contacts group.)

This upgrade logic does roughly the following, for every chat path, to
accomplish the migration:
1. delete ./read and ./write groups associated with the chat
2. create a new group containing an approximate "uni" of the old groups
3. register the chat + new group with the metadata-store
4. hook the group up to its matching permission set

Note that because existing groups are hooked up through the
permission-group-hook, doing step 1 deletes the associated permissions.
Step 4 then re-establishes that relation for the newly created group.

The logic here scries into the metadata-store, and as such depends on
that having been started prior to this upgrade process.

urbit/urbit,urbit/urbit,jfranklin9000/urbit,jfranklin9000/urbit,jfranklin9000/urbit,ngzax/urbit,urbit/urbit,ngzax/urbit,jfranklin9000/urbit,urbit/urbit,ngzax/urbit,ngzax/urbit,ngzax/urbit,urbit/urbit,urbit/urbit,jfranklin9000/urbit,ngzax/urbit,urbit/urbit,jfranklin9000/urbit,jfranklin9000/urbit,ngzax/urbit