[Keyserver] Refactor identity utilities
Summary:
These are useful when interacting with identity service,
pull them out of login.js to make them more widely available.
Part of https://linear.app/comm/issue/ENG-3944
Depends on D8474
Test Plan: Launch keyserver with login workflow (missing identity info)
Reviewers: kamil, michal, ashoat
Reviewed By: kamil, ashoat
Subscribers: ashoat, tomek
Differential Revision: https://phab.comm.dev/D8475