[lib] implementing handling peer-to-peer messages
Summary:
Making this shared code on the web and native using methods implemented in previous diffs.
This will simplify working with peer-to-peer messages in the future.
Depends on D11119
Test Plan:
Native: just a refactor
Web: tested in next diff
Reviewers: marcin, varun, tomek, michal
Reviewed By: tomek
Subscribers: ashoat
Differential Revision: https://phab.comm.dev/D11120