Speed up linearize
Speed up linearize

Summary:
speed up linearize with a couple things:
* `emplace` doesn't overwrite and returns a pair telling if insertion succeeded. Use that info to avoid an extra `count` call.
* `find` can replace `count` + `at`
* and minimize lookups to hashtables if we can learn the information we seek another way.

Reviewed By: int3

Differential Revision: D10244514

fbshipit-source-id: 73bbcced830fbde5999a733f3f5171ec5c145311

facebook/redex,facebook/redex,facebook/redex,facebook/redex,facebook/redex,facebook/redex,facebook/redex,facebook/redex,facebook/redex