[identity] refactor message validation
Summary:
a lot of this code will be reused later when we validate messages from the keyserver to add and remove usernames from the reserved list
this refactor makes it easier to reuse the validation code
Depends on D8231
Test Plan: tested later when the validate helper is called
Reviewers: jon, bartek
Reviewed By: bartek
Subscribers: ashoat, tomek
Differential Revision: https://phab.comm.dev/D8232