process libs before client code
process libs before client code

Summary:
Previously, we would load library code between the infer and merge
phases of the initial typecheck. This diff moves that step to before
the infer phase.

Aside from reordering work, this leaves behavior
unchanged. Further work includes

- normalizing the processing of library files, so they can be rechecked incrementally
- using library definitions at infer time to avoid
-- undetected misuse of global symbols (see `Env_js.cache_global` for more info)
-- requests for annotation on certain uses of library definitions involving union or intersection types

Reviewed By: jeffmo

Differential Revision: D3508548

fbshipit-source-id: fbd05a81829684e334863792607c485232cd4edd

AgentME/flow,AprilArcus/flow,fletcherw/flow,facebook/flow,gabelevi/flow,gabelevi/flow,chenglou/flow,MichaelDeBoey/flow,ForbesLindesay/flow,claudiopro/flow,MichaelDeBoey/flow,popham/flow,TiddoLangerak/flow,gabelevi/flow,jamesgpearce/flow,mroch/flow,gabro/flow,claudiopro/flow,ylu1317/flow,nmote/flow,TiddoLangerak/flow,nmote/flow,ylu1317/flow,samwgoldman/flow,gabro/flow,jamesgpearce/flow,jdelStrother/flow,fletcherw/flow,jeffmo/flow,chenglou/flow,cesarandreu/flow,chenglou/flow,fletcherw/flow,AprilArcus/flow,ForbesLindesay/flow,mroch/flow,samwgoldman/flow,gabro/flow,cesarandreu/flow,jgrund/flow,jeffmo/flow,jamesgpearce/flow,fletcherw/flow,claudiopro/flow,TiddoLangerak/flow,mroch/flow,nmote/flow,gabelevi/flow,mroch/flow,AgentME/flow,popham/flow,chenglou/flow,gabelevi/flow,jgrund/flow,jamesgpearce/flow,popham/flow,TiddoLangerak/flow,nmote/flow,AgentME/flow,AprilArcus/flow,nmote/flow,mroch/flow,facebook/flow,MichaelDeBoey/flow,JonathanUsername/flow,jdelStrother/flow,jeffmo/flow,AprilArcus/flow,fletcherw/flow,facebook/flow,JonathanUsername/flow,AgentME/flow,facebook/flow,jamesgpearce/flow,jdelStrother/flow,jamesgpearce/flow,JonathanUsername/flow,popham/flow,popham/flow,jeffmo/flow,ForbesLindesay/flow,samwgoldman/flow,samwgoldman/flow,jgrund/flow,jgrund/flow,ForbesLindesay/flow,facebook/flow,gabro/flow,MichaelDeBoey/flow,gabelevi/flow,cesarandreu/flow,samwgoldman/flow,ylu1317/flow,mroch/flow,JonathanUsername/flow,samwgoldman/flow,nmote/flow,gabelevi/flow,AgentME/flow,AprilArcus/flow,samwgoldman/flow,jgrund/flow,jdelStrother/flow,jeffmo/flow,jamesgpearce/flow,ylu1317/flow,popham/flow,fletcherw/flow,cesarandreu/flow,JonathanUsername/flow,JonathanUsername/flow,AprilArcus/flow,ForbesLindesay/flow,facebook/flow,nmote/flow,jdelStrother/flow,MichaelDeBoey/flow,gabro/flow,ylu1317/flow,ForbesLindesay/flow,chenglou/flow,jeffmo/flow,jgrund/flow,popham/flow,gabro/flow,chenglou/flow,jdelStrother/flow,claudiopro/flow,facebook/flow,JonathanUsername/flow,mroch/flow,TiddoLangerak/flow,claudiopro/flow