[lib] Move conversion function out of validation utils
Summary: Changes required for fixing ENG-4670 introduce some cyclic dependencies so we need to move some things around.
Test Plan: yarn test-all, yarn eslint, yarn flow-all
Reviewers: tomek, inka, kamil, ginsu
Reviewed By: kamil
Subscribers: ashoat
Differential Revision: https://phab.comm.dev/D8879