[keyserver] refactor identity.js
Summary:
initially i was going to store the primary device ID in the metadata table, but i realized soon after that this wasn't necessary. nonetheless, i thought this change could be useful if we decide to add more rows to the metadata table in the future.
Depends on D12161
Test Plan: successfully updated and fetched identity info from mariadb by calling these functions from keyserver.js
Reviewers: ashoat, inka
Reviewed By: ashoat
Subscribers: tomek
Differential Revision: https://phab.comm.dev/D12211