WIP: Sketch implementation for negotiation for prop324
DO NOT MERGE THIS BRANCH!
This is an attempt to start fleshing out the missing parts of negotiation for proposal 324. The entirety of the real negotiation process is omitted; see commented with "TODO-324" for parts that absolutely must get solved before merging.
Whoever picks this up: don't just resolve all the TODO-324 parts! You'll need to understand everything here, and probably write some more tests, to make sure that things come out correct in the end.
Please give me a chance to review the final version before merge.
DO NOT MERGE THIS BRANCH