[lib] Move minimallyEncodedPermissions types/type utils to separate file
Summary: This is an attempt to resolve circular dependency issue...
Test Plan: Hopefully will be able to proceed without Jest import issues. Will resolve merge conflicts and then HOPEFULLY will be able to put up refactoring diffs.
Reviewers: ashoat, ginsu, tomek, rohan
Reviewed By: ashoat
Subscribers: wyilio
Differential Revision: https://phab.comm.dev/D9808