[lib] move olm utils from keyserver to lib
Summary: we can reuse these on web, too, so moving them out of keyserver
Test Plan: able to log in to staging identity service from my local keyserver after clearing the metadata table
Reviewers: ashoat, kamil, marcin
Reviewed By: ashoat, marcin
Subscribers: tomek
Differential Revision: https://phab.comm.dev/D10876