Port back vtgate.py with style changes and bug fix.
Port back vtgate.py with style changes and bug fix.

tjyang/vitess,skyportsystems/vitess,erzel/vitess,anusornc/vitess,tjyang/vitess,erzel/vitess,mahak/vitess,nurblieh/vitess,aaijazi/vitess,yangzhongj/vitess,netroby/vitess,netroby/vitess,skyportsystems/vitess,mapbased/vitess,enisoc/vitess,applift/vitess,nurblieh/vitess,mlc0202/vitess,pivanof/vitess,aaijazi/vitess,mlc0202/vitess,dcadevil/vitess,ngaut/vitess,netroby/vitess,yaoshengzhe/vitess,davygeek/vitess,vitessio/vitess,davygeek/vitess,atyenoria/vitess,applift/vitess,tirsen/vitess,ptomasroos/vitess,xgwubin/vitess,sougou/vitess,yangzhongj/vitess,mapbased/vitess,cloudbearings/vitess,anusornc/vitess,HubSpot/vitess,applift/vitess,applift/vitess,anusornc/vitess,HubSpot/vitess,atyenoria/vitess,kmiku7/vitess-annotated,cgvarela/vitess,nurblieh/vitess,netroby/vitess,tjyang/vitess,tirsen/vitess,tjyang/vitess,nurblieh/vitess,mattharden/vitess,AndyDiamondstein/vitess,xgwubin/vitess,kuipertan/vitess,dcadevil/vitess,guokeno0/vitess,cloudbearings/vitess,guokeno0/vitess,applift/vitess,HubSpot/vitess,cloudbearings/vitess,nurblieh/vitess,mlc0202/vitess,michael-berlin/vitess,ptomasroos/vitess,mlc0202/vitess,atyenoria/vitess,kmiku7/vitess-annotated,skyportsystems/vitess,nurblieh/vitess,aaijazi/vitess,pivanof/vitess,michael-berlin/vitess,mlc0202/vitess,AndyDiamondstein/vitess,skyportsystems/vitess,cloudbearings/vitess,fengshao0907/vitess,mahak/vitess,guokeno0/vitess,kmiku7/vitess-annotated,AndyDiamondstein/vitess,ptomasroos/vitess,tirsen/vitess,applift/vitess,alainjobart/vitess,davygeek/vitess,mattharden/vitess,guokeno0/vitess,HubSpot/vitess,fengshao0907/vitess,tinyspeck/vitess,ngaut/vitess,rnavarro/vitess,yaoshengzhe/vitess,guokeno0/vitess,mattharden/vitess,yaoshengzhe/vitess,sougou/vitess,AndyDiamondstein/vitess,mattharden/vitess,vitessio/vitess,kmiku7/vitess-annotated,ptomasroos/vitess,aaijazi/vitess,mapbased/vitess,SDHM/vitess,SDHM/vitess,michael-berlin/vitess,kmiku7/vitess-annotated,guokeno0/vitess,SDHM/vitess,cloudbearings/vitess,yaoshengzhe/vitess,rnavarro/vitess,aaijazi/vitess,rnavarro/vitess,HubSpot/vitess,xgwubin/vitess,michael-berlin/vitess,aaijazi/vitess,AndyDiamondstein/vitess,cgvarela/vitess,dcadevil/vitess,apmichaud/vitess-apm,cgvarela/vitess,anusornc/vitess,applift/vitess,HubSpot/vitess,dcadevil/vitess,rnavarro/vitess,tinyspeck/vitess,rnavarro/vitess,cloudbearings/vitess,kuipertan/vitess,vitessio/vitess,dumbunny/vitess,ngaut/vitess,mattharden/vitess,mapbased/vitess,netroby/vitess,dumbunny/vitess,atyenoria/vitess,dumbunny/vitess,tinyspeck/vitess,tjyang/vitess,yaoshengzhe/vitess,erzel/vitess,cgvarela/vitess,mahak/vitess,dumbunny/vitess,cgvarela/vitess,enisoc/vitess,pivanof/vitess,ptomasroos/vitess,SDHM/vitess,skyportsystems/vitess,netroby/vitess,alainjobart/vitess,mlc0202/vitess,michael-berlin/vitess,erzel/vitess,xgwubin/vitess,erzel/vitess,mlc0202/vitess,SDHM/vitess,yaoshengzhe/vitess,davygeek/vitess,cloudbearings/vitess,guokeno0/vitess,yangzhongj/vitess,skyportsystems/vitess,mahak/vitess,ptomasroos/vitess,anusornc/vitess,kuipertan/vitess,AndyDiamondstein/vitess,SDHM/vitess,fengshao0907/vitess,atyenoria/vitess,mlc0202/vitess,alainjobart/vitess,kuipertan/vitess,mapbased/vitess,tirsen/vitess,anusornc/vitess,cgvarela/vitess,cgvarela/vitess,fengshao0907/vitess,fengshao0907/vitess,skyportsystems/vitess,apmichaud/vitess-apm,xgwubin/vitess,tinyspeck/vitess,xgwubin/vitess,mahak/vitess,pivanof/vitess,dumbunny/vitess,mapbased/vitess,erzel/vitess,sougou/vitess,dumbunny/vitess,xgwubin/vitess,cgvarela/vitess,dcadevil/vitess,sougou/vitess,atyenoria/vitess,vitessio/vitess,sougou/vitess,yangzhongj/vitess,pivanof/vitess,mapbased/vitess,yaoshengzhe/vitess,vitessio/vitess,tinyspeck/vitess,alainjobart/vitess,aaijazi/vitess,fengshao0907/vitess,apmichaud/vitess-apm,tirsen/vitess,atyenoria/vitess,tjyang/vitess,ptomasroos/vitess,skyportsystems/vitess,dumbunny/vitess,aaijazi/vitess,kuipertan/vitess,erzel/vitess,michael-berlin/vitess,erzel/vitess,tirsen/vitess,enisoc/vitess,erzel/vitess,applift/vitess,yangzhongj/vitess,dumbunny/vitess,vitessio/vitess,michael-berlin/vitess,dcadevil/vitess,dumbunny/vitess,yangzhongj/vitess,rnavarro/vitess,netroby/vitess,netroby/vitess,michael-berlin/vitess,HubSpot/vitess,tinyspeck/vitess,mapbased/vitess,cloudbearings/vitess,tjyang/vitess,mattharden/vitess,nurblieh/vitess,mattharden/vitess,alainjobart/vitess,pivanof/vitess,mlc0202/vitess,xgwubin/vitess,kmiku7/vitess-annotated,SDHM/vitess,SDHM/vitess,dumbunny/vitess,davygeek/vitess,kuipertan/vitess,yangzhongj/vitess,alainjobart/vitess,nurblieh/vitess,netroby/vitess,guokeno0/vitess,kuipertan/vitess,AndyDiamondstein/vitess,rnavarro/vitess,sougou/vitess,tinyspeck/vitess,mapbased/vitess,vitessio/vitess,erzel/vitess,enisoc/vitess,apmichaud/vitess-apm,anusornc/vitess,applift/vitess,rnavarro/vitess,yangzhongj/vitess,sougou/vitess,tirsen/vitess,fengshao0907/vitess,enisoc/vitess,yangzhongj/vitess,mattharden/vitess,tirsen/vitess,tjyang/vitess,skyportsystems/vitess,ngaut/vitess,enisoc/vitess,yaoshengzhe/vitess,apmichaud/vitess-apm,mattharden/vitess,ptomasroos/vitess,michael-berlin/vitess,nurblieh/vitess,kmiku7/vitess-annotated,yaoshengzhe/vitess,mahak/vitess,pivanof/vitess,cgvarela/vitess,enisoc/vitess,ptomasroos/vitess,anusornc/vitess,pivanof/vitess,alainjobart/vitess,kmiku7/vitess-annotated,atyenoria/vitess,davygeek/vitess,fengshao0907/vitess,AndyDiamondstein/vitess,mattharden/vitess,AndyDiamondstein/vitess,ngaut/vitess,vitessio/vitess,pivanof/vitess,tirsen/vitess,HubSpot/vitess,atyenoria/vitess,applift/vitess,alainjobart/vitess,SDHM/vitess,xgwubin/vitess,anusornc/vitess,rnavarro/vitess,davygeek/vitess,mahak/vitess,dcadevil/vitess,aaijazi/vitess,mahak/vitess,tjyang/vitess,cloudbearings/vitess,kmiku7/vitess-annotated,kuipertan/vitess,kuipertan/vitess,sougou/vitess,fengshao0907/vitess,guokeno0/vitess,mapbased/vitess