Cleanup and refactor common queries
Cleanup and refactor common queries

Summary: The version query is repeated many times. Make it a static immutable map

Test Plan: ./bin/buck test test/com/facebook/buck/io/...

Reviewed By: bhamiltoncx

fbshipit-source-id: af6c9f6

dsyang/buck,clonetwin26/buck,justinmuller/buck,romanoid/buck,davido/buck,zhan-xiong/buck,shybovycha/buck,LegNeato/buck,sdwilsh/buck,ilya-klyuchnikov/buck,vschs007/buck,sdwilsh/buck,davido/buck,davido/buck,Addepar/buck,shybovycha/buck,clonetwin26/buck,JoelMarcey/buck,nguyentruongtho/buck,sdwilsh/buck,OkBuilds/buck,k21/buck,dsyang/buck,Addepar/buck,dsyang/buck,Addepar/buck,SeleniumHQ/buck,illicitonion/buck,zpao/buck,k21/buck,rmaz/buck,daedric/buck,LegNeato/buck,zpao/buck,illicitonion/buck,kageiit/buck,brettwooldridge/buck,brettwooldridge/buck,ilya-klyuchnikov/buck,clonetwin26/buck,OkBuilds/buck,clonetwin26/buck,LegNeato/buck,rmaz/buck,LegNeato/buck,LegNeato/buck,OkBuilds/buck,shybovycha/buck,clonetwin26/buck,nguyentruongtho/buck,vschs007/buck,kageiit/buck,LegNeato/buck,davido/buck,rmaz/buck,k21/buck,marcinkwiatkowski/buck,zhan-xiong/buck,vschs007/buck,dsyang/buck,vschs007/buck,shs96c/buck,justinmuller/buck,davido/buck,justinmuller/buck,illicitonion/buck,dsyang/buck,facebook/buck,kageiit/buck,romanoid/buck,JoelMarcey/buck,zpao/buck,shs96c/buck,vschs007/buck,kageiit/buck,daedric/buck,JoelMarcey/buck,k21/buck,grumpyjames/buck,romanoid/buck,marcinkwiatkowski/buck,grumpyjames/buck,dsyang/buck,daedric/buck,darkforestzero/buck,romanoid/buck,justinmuller/buck,ilya-klyuchnikov/buck,OkBuilds/buck,robbertvanginkel/buck,ilya-klyuchnikov/buck,darkforestzero/buck,Addepar/buck,robbertvanginkel/buck,davido/buck,robbertvanginkel/buck,robbertvanginkel/buck,illicitonion/buck,daedric/buck,illicitonion/buck,daedric/buck,zpao/buck,JoelMarcey/buck,facebook/buck,marcinkwiatkowski/buck,justinmuller/buck,rmaz/buck,LegNeato/buck,marcinkwiatkowski/buck,clonetwin26/buck,Addepar/buck,grumpyjames/buck,vschs007/buck,darkforestzero/buck,shs96c/buck,daedric/buck,k21/buck,SeleniumHQ/buck,darkforestzero/buck,illicitonion/buck,JoelMarcey/buck,shybovycha/buck,vschs007/buck,Addepar/buck,darkforestzero/buck,rmaz/buck,justinmuller/buck,k21/buck,marcinkwiatkowski/buck,brettwooldridge/buck,justinmuller/buck,OkBuilds/buck,facebook/buck,JoelMarcey/buck,zhan-xiong/buck,brettwooldridge/buck,marcinkwiatkowski/buck,shs96c/buck,justinmuller/buck,shs96c/buck,SeleniumHQ/buck,OkBuilds/buck,SeleniumHQ/buck,sdwilsh/buck,illicitonion/buck,grumpyjames/buck,zpao/buck,sdwilsh/buck,robbertvanginkel/buck,zhan-xiong/buck,justinmuller/buck,grumpyjames/buck,LegNeato/buck,clonetwin26/buck,davido/buck,darkforestzero/buck,darkforestzero/buck,k21/buck,k21/buck,davido/buck,darkforestzero/buck,LegNeato/buck,davido/buck,k21/buck,robbertvanginkel/buck,romanoid/buck,illicitonion/buck,zhan-xiong/buck,darkforestzero/buck,grumpyjames/buck,ilya-klyuchnikov/buck,vschs007/buck,JoelMarcey/buck,robbertvanginkel/buck,robbertvanginkel/buck,daedric/buck,romanoid/buck,zhan-xiong/buck,facebook/buck,Addepar/buck,grumpyjames/buck,sdwilsh/buck,ilya-klyuchnikov/buck,sdwilsh/buck,LegNeato/buck,sdwilsh/buck,grumpyjames/buck,illicitonion/buck,shybovycha/buck,ilya-klyuchnikov/buck,OkBuilds/buck,rmaz/buck,Addepar/buck,robbertvanginkel/buck,vschs007/buck,clonetwin26/buck,dsyang/buck,illicitonion/buck,JoelMarcey/buck,brettwooldridge/buck,daedric/buck,marcinkwiatkowski/buck,OkBuilds/buck,OkBuilds/buck,sdwilsh/buck,brettwooldridge/buck,justinmuller/buck,zhan-xiong/buck,zhan-xiong/buck,marcinkwiatkowski/buck,Addepar/buck,davido/buck,davido/buck,rmaz/buck,SeleniumHQ/buck,Addepar/buck,nguyentruongtho/buck,SeleniumHQ/buck,vschs007/buck,k21/buck,LegNeato/buck,zhan-xiong/buck,JoelMarcey/buck,rmaz/buck,daedric/buck,marcinkwiatkowski/buck,JoelMarcey/buck,ilya-klyuchnikov/buck,brettwooldridge/buck,sdwilsh/buck,LegNeato/buck,ilya-klyuchnikov/buck,romanoid/buck,SeleniumHQ/buck,shybovycha/buck,sdwilsh/buck,robbertvanginkel/buck,LegNeato/buck,romanoid/buck,robbertvanginkel/buck,vschs007/buck,SeleniumHQ/buck,clonetwin26/buck,ilya-klyuchnikov/buck,grumpyjames/buck,sdwilsh/buck,marcinkwiatkowski/buck,shybovycha/buck,illicitonion/buck,kageiit/buck,shybovycha/buck,romanoid/buck,clonetwin26/buck,SeleniumHQ/buck,zhan-xiong/buck,SeleniumHQ/buck,zpao/buck,daedric/buck,OkBuilds/buck,k21/buck,davido/buck,zhan-xiong/buck,rmaz/buck,illicitonion/buck,ilya-klyuchnikov/buck,vschs007/buck,grumpyjames/buck,clonetwin26/buck,SeleniumHQ/buck,OkBuilds/buck,zhan-xiong/buck,facebook/buck,facebook/buck,zpao/buck,robbertvanginkel/buck,shybovycha/buck,kageiit/buck,darkforestzero/buck,shs96c/buck,daedric/buck,brettwooldridge/buck,shs96c/buck,rmaz/buck,romanoid/buck,Addepar/buck,sdwilsh/buck,clonetwin26/buck,nguyentruongtho/buck,darkforestzero/buck,romanoid/buck,shybovycha/buck,shs96c/buck,ilya-klyuchnikov/buck,dsyang/buck,dsyang/buck,robbertvanginkel/buck,OkBuilds/buck,brettwooldridge/buck,darkforestzero/buck,darkforestzero/buck,brettwooldridge/buck,shybovycha/buck,daedric/buck,shs96c/buck,marcinkwiatkowski/buck,daedric/buck,k21/buck,dsyang/buck,OkBuilds/buck,facebook/buck,rmaz/buck,shs96c/buck,brettwooldridge/buck,shs96c/buck,ilya-klyuchnikov/buck,kageiit/buck,nguyentruongtho/buck,dsyang/buck,SeleniumHQ/buck,romanoid/buck,dsyang/buck,JoelMarcey/buck,Addepar/buck,nguyentruongtho/buck,rmaz/buck,JoelMarcey/buck,illicitonion/buck,vschs007/buck,JoelMarcey/buck,zhan-xiong/buck,shs96c/buck,nguyentruongtho/buck,marcinkwiatkowski/buck,justinmuller/buck,SeleniumHQ/buck,k21/buck,grumpyjames/buck,clonetwin26/buck,brettwooldridge/buck,justinmuller/buck,shybovycha/buck,grumpyjames/buck,Addepar/buck,justinmuller/buck,romanoid/buck,shybovycha/buck,davido/buck,dsyang/buck,rmaz/buck,brettwooldridge/buck,shs96c/buck,marcinkwiatkowski/buck