[chore] clean up parse_lib_file
[chore] clean up parse_lib_file

Summary:
computing `List.length` or `Set.cardinal` is O(n), but `is_empty` is O(1).

also added some helper functions to make ocamlformat indent everything more nicely.

Reviewed By: jbrown215

Differential Revision: D26103684

fbshipit-source-id: 924d2aff47587aec1e47750ce2f07a0491d2e211

nmote/flow,nmote/flow,nmote/flow,nmote/flow,nmote/flow,nmote/flow,nmote/flow