refactoring function scope building
refactoring function scope building

Summary:
Implementing scopes exposed some mismatched push/pop calls. This diff moves some
common code between function_declaration and function_ that makes push/pop
matching more obviously correct.

We could use with_bindings to further tighten matching, but that seems like a
violation of the current contract of with_bindings, so we leave that work for
later. (It's API is designed to enclose a node -> node mapper, whereas the way
we would use it here would be by encloding a unit -> unit task.)

Reviewed By: mroch

Differential Revision: D5369759

fbshipit-source-id: a92a5828bb9dfedcc213e166cdc56ce65052ee76

JonathanUsername/flow,samwgoldman/flow,claudiopro/flow,JonathanUsername/flow,ylu1317/flow,popham/flow,mroch/flow,JonathanUsername/flow,TiddoLangerak/flow,popham/flow,mroch/flow,AgentME/flow,MichaelDeBoey/flow,facebook/flow,mroch/flow,TiddoLangerak/flow,mroch/flow,JonathanUsername/flow,samwgoldman/flow,AgentME/flow,claudiopro/flow,samwgoldman/flow,gabelevi/flow,samwgoldman/flow,jamesgpearce/flow,JonathanUsername/flow,mroch/flow,nmote/flow,MichaelDeBoey/flow,gabelevi/flow,TiddoLangerak/flow,claudiopro/flow,ylu1317/flow,ylu1317/flow,MichaelDeBoey/flow,nmote/flow,TiddoLangerak/flow,AgentME/flow,jamesgpearce/flow,facebook/flow,popham/flow,popham/flow,mroch/flow,AgentME/flow,MichaelDeBoey/flow,MichaelDeBoey/flow,gabelevi/flow,jamesgpearce/flow,popham/flow,nmote/flow,gabelevi/flow,facebook/flow,facebook/flow,JonathanUsername/flow,nmote/flow,gabelevi/flow,samwgoldman/flow,gabelevi/flow,facebook/flow,claudiopro/flow,nmote/flow,claudiopro/flow,nmote/flow,jamesgpearce/flow,samwgoldman/flow,JonathanUsername/flow,popham/flow,nmote/flow,facebook/flow,popham/flow,facebook/flow,AgentME/flow,jamesgpearce/flow,mroch/flow,ylu1317/flow,gabelevi/flow,TiddoLangerak/flow,jamesgpearce/flow,samwgoldman/flow,jamesgpearce/flow,ylu1317/flow