Fix hack javascript wanting tons of dependencies

Summary: For the test case described in D1567415, 3000 dependencies are pulled in before this change. 200 are pulled in after.

-When we implemented the js version of hack, we needed a way to figure out what dependencies we need.
-On the IDE client, the user would open a file, and we'd try to typecheck it.
-When we finished typechecking, we needed to know what dependencies were missing (so we could pull them in)
-This was accomplished by replacing the Typing_deps module. By replacing the model, we can find out the names of every dependency the client has seen.

Now, say I'm typechecking FileA and FileA has a dependency on FileB. FileB has a dependency on FileC.
When I typecheck FileA, I find out that I need FileB, so I hh_add_dep FileB. When FileB gets named and decled, it adds FileC to our dep set.

However, we don't actually need FileC, unless FileB is inheriting from FileC. This change makes it so that FileC would not be added in this case.

My fix is kind of hacky (using a reference), but seemed like the simplest way to keep the change isolated to the hh_ide javascript stuff.

Reviewed By: @jwatzman

Differential Revision: D1575078