Auto merge of #5747 - dhananjay92:Issue#5730, r=jdm
Auto merge of #5747 - dhananjay92:Issue#5730, r=jdm

This PR does two things.
* Solve Issue #5730 
* Refactor `tidy.py` to reduce code duplication.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/5747)
<!-- Reviewable:end -->

kindersung/servo,anthgur/servo,mattnenterprise/servo,jimberlage/servo,mbrubeck/servo,kindersung/servo,g-k/servo,aidanhs/servo,mattnenterprise/servo,hyowon/servo,pgonda/servo,saneyuki/servo,steveklabnik/servo,fiji-flo/servo,szeged/servo,hyowon/servo,caldwell/servo,anthgur/servo,peterjoel/servo,zentner-kyle/servo,akosel/servo,RenaudParis/servo,zentner-kyle/servo,pgonda/servo,codemac/servo,RenaudParis/servo,thiagopnts/servo,tempbottle/servo,wpgallih/servo,dagnir/servo,mbrubeck/servo,saneyuki/servo,GreenRecycleBin/servo,peterjoel/servo,ryancanhelpyou/servo,AnthonyBroadCrawford/servo,nick-thompson/servo,thiagopnts/servo,RenaudParis/servo,wpgallih/servo,caldwell/servo,rentongzhang/servo,aidanhs/servo,anthgur/servo,samfoo/servo,splav/servo,meh/servo,emilio/servo,fiji-flo/servo,karlito40/servo,runarberg/servo,WriterOfAlicrow/servo,pgonda/servo,huonw/servo,tschneidereit/servo,brendandahl/servo,tafia/servo,rnestler/servo,CJ8664/servo,bjwbell/servo,hyowon/servo,CJ8664/servo,CJ8664/servo,DominoTree/servo,zentner-kyle/servo,huonw/servo,larsbergstrom/servo,dhananjay92/servo,DominoTree/servo,splav/servo,deokjinkim/servo,KiChjang/servo,samfoo/servo,SimonSapin/servo,nnethercote/servo,AnthonyBroadCrawford/servo,codemac/servo,bjwbell/servo,szeged/servo,youprofit/servo,zentner-kyle/servo,codemac/servo,samfoo/servo,KiChjang/servo,rixrix/servo,saratang/servo,aidanhs/servo,nerith/servo,mt2d2/servo,pyecs/servo,runarberg/servo,splav/servo,dati91/servo,jlegendary/servo,mt2d2/servo,paulrouget/servo,nerith/servo,dsandeephegde/servo,notriddle/servo,peterjoel/servo,huonw/servo,szeged/servo,s142857/servo,nick-thompson/servo,fiji-flo/servo,saneyuki/servo,paulrouget/servo,notriddle/servo,wartman4404/servo,upsuper/servo,meh/servo,larsbergstrom/servo,huonw/servo,tempbottle/servo,evilpie/servo,brendandahl/servo,s142857/servo,peterjoel/servo,splav/servo,anthgur/servo,SimonSapin/servo,j3parker/servo,j3parker/servo,wpgallih/servo,upsuper/servo,DominoTree/servo,meh/servo,dati91/servo,kindersung/servo,s142857/servo,dati91/servo,avadacatavra/servo,larsbergstrom/servo,bjwbell/servo,aidanhs/servo,eddyb/servo,rnestler/servo,jimberlage/servo,DominoTree/servo,emilio/servo,avadacatavra/servo,DominoTree/servo,pyfisch/servo,evilpie/servo,paulrouget/servo,kindersung/servo,dsandeephegde/servo,saneyuki/servo,cbrewster/servo,mdibaiee/servo,tafia/servo,peterjoel/servo,karlito40/servo,nnethercote/servo,CJ8664/servo,nnethercote/servo,saneyuki/servo,zhangjunlei26/servo,jdramani/servo,tschneidereit/servo,emilio/servo,tempbottle/servo,rixrix/servo,GyrosOfWar/servo,CJ8664/servo,rentongzhang/servo,GyrosOfWar/servo,nerith/servo,avadacatavra/servo,ConnorGBrewster/servo,rnestler/servo,meh/servo,wpgallih/servo,zhangjunlei26/servo,wpgallih/servo,boghison/servo,aweinstock314/servo,g-k/servo,nrc/servo,jdramani/servo,akosel/servo,aidanhs/servo,emilio/servo,wartman4404/servo,saratang/servo,jlegendary/servo,thiagopnts/servo,s142857/servo,mdibaiee/servo,dagnir/servo,meh/servo,deokjinkim/servo,nrc/servo,caldwell/servo,youprofit/servo,boghison/servo,mattnenterprise/servo,vks/servo,hyowon/servo,nnethercote/servo,mdibaiee/servo,vks/servo,saratang/servo,jdramani/servo,deokjinkim/servo,splav/servo,aweinstock314/servo,KiChjang/servo,paulrouget/servo,GyrosOfWar/servo,sadmansk/servo,splav/servo,paulrouget/servo,dsandeephegde/servo,larsbergstrom/servo,ryancanhelpyou/servo,steveklabnik/servo,youprofit/servo,jdramani/servo,fiji-flo/servo,dvberkel/servo,dvberkel/servo,AnthonyBroadCrawford/servo,RenaudParis/servo,thiagopnts/servo,youprofit/servo,saneyuki/servo,DominoTree/servo,szeged/servo,zhangjunlei26/servo,fiji-flo/servo,notriddle/servo,CJ8664/servo,runarberg/servo,canaltinova/servo,pyfisch/servo,avadacatavra/servo,vks/servo,saneyuki/servo,pyfisch/servo,nick-thompson/servo,eddyb/servo,dsandeephegde/servo,cbrewster/servo,sadmansk/servo,A-deLuna/servo,pyecs/servo,paulrouget/servo,nerith/servo,notriddle/servo,dagnir/servo,larsbergstrom/servo,jimberlage/servo,larsbergstrom/servo,notriddle/servo,WriterOfAlicrow/servo,boghison/servo,samfoo/servo,steveklabnik/servo,j3parker/servo,mt2d2/servo,GreenRecycleBin/servo,RenaudParis/servo,dsandeephegde/servo,runarberg/servo,anthgur/servo,g-k/servo,hyowon/servo,peterjoel/servo,peterjoel/servo,ConnorGBrewster/servo,evilpie/servo,AnthonyBroadCrawford/servo,KiChjang/servo,evilpie/servo,tafia/servo,pgonda/servo,evilpie/servo,tschneidereit/servo,pyfisch/servo,canaltinova/servo,larsbergstrom/servo,fiji-flo/servo,pyfisch/servo,A-deLuna/servo,rixrix/servo,SimonSapin/servo,GreenRecycleBin/servo,WriterOfAlicrow/servo,tafia/servo,jlegendary/servo,wartman4404/servo,tafia/servo,mbrubeck/servo,mt2d2/servo,szeged/servo,notriddle/servo,paulrouget/servo,aweinstock314/servo,mbrubeck/servo,canaltinova/servo,SimonSapin/servo,huonw/servo,eddyb/servo,nerith/servo,KiChjang/servo,youprofit/servo,GreenRecycleBin/servo,boghison/servo,fiji-flo/servo,mattnenterprise/servo,g-k/servo,cbrewster/servo,paulrouget/servo,canaltinova/servo,dvberkel/servo,dati91/servo,CJ8664/servo,deokjinkim/servo,GreenRecycleBin/servo,jdramani/servo,brendandahl/servo,steveklabnik/servo,wpgallih/servo,dvberkel/servo,rixrix/servo,s142857/servo,wartman4404/servo,notriddle/servo,codemac/servo,szeged/servo,karlito40/servo,kindersung/servo,karlito40/servo,dagnir/servo,nnethercote/servo,jlegendary/servo,thiagopnts/servo,SimonSapin/servo,steveklabnik/servo,dhananjay92/servo,bjwbell/servo,tschneidereit/servo,kindersung/servo,vks/servo,ryancanhelpyou/servo,tschneidereit/servo,fiji-flo/servo,akosel/servo,ConnorGBrewster/servo,emilio/servo,rentongzhang/servo,pyfisch/servo,codemac/servo,zhangjunlei26/servo,sadmansk/servo,canaltinova/servo,dvberkel/servo,ryancanhelpyou/servo,jgraham/servo,caldwell/servo,zhangjunlei26/servo,steveklabnik/servo,mattnenterprise/servo,SimonSapin/servo,aweinstock314/servo,dsandeephegde/servo,jimberlage/servo,GyrosOfWar/servo,SimonSapin/servo,dhananjay92/servo,anthgur/servo,mt2d2/servo,jgraham/servo,sadmansk/servo,eddyb/servo,rixrix/servo,walac/servo,eddyb/servo,vks/servo,bjwbell/servo,zhangjunlei26/servo,zhangjunlei26/servo,larsbergstrom/servo,caldwell/servo,mdibaiee/servo,nrc/servo,j3parker/servo,caldwell/servo,nick-thompson/servo,A-deLuna/servo,DominoTree/servo,mattnenterprise/servo,GyrosOfWar/servo,zhangjunlei26/servo,pgonda/servo,dhananjay92/servo,deokjinkim/servo,rentongzhang/servo,avadacatavra/servo,GreenRecycleBin/servo,jimberlage/servo,canaltinova/servo,jimberlage/servo,nick-thompson/servo,saratang/servo,aweinstock314/servo,karlito40/servo,nrc/servo,avadacatavra/servo,paulrouget/servo,evilpie/servo,thiagopnts/servo,dati91/servo,huonw/servo,akosel/servo,j3parker/servo,A-deLuna/servo,GreenRecycleBin/servo,jimberlage/servo,AnthonyBroadCrawford/servo,boghison/servo,nnethercote/servo,KiChjang/servo,peterjoel/servo,dvberkel/servo,samfoo/servo,AnthonyBroadCrawford/servo,splav/servo,avadacatavra/servo,caldwell/servo,bjwbell/servo,walac/servo,larsbergstrom/servo,jgraham/servo,hyowon/servo,A-deLuna/servo,KiChjang/servo,karlito40/servo,rixrix/servo,szeged/servo,dati91/servo,nnethercote/servo,emilio/servo,WriterOfAlicrow/servo,KiChjang/servo,wartman4404/servo,GreenRecycleBin/servo,dagnir/servo,mattnenterprise/servo,rnestler/servo,nick-thompson/servo,cbrewster/servo,saratang/servo,upsuper/servo,pgonda/servo,walac/servo,tempbottle/servo,ConnorGBrewster/servo,upsuper/servo,youprofit/servo,jgraham/servo,rnestler/servo,rnestler/servo,dvberkel/servo,ryancanhelpyou/servo,mbrubeck/servo,emilio/servo,akosel/servo,nnethercote/servo,jlegendary/servo,jdramani/servo,mbrubeck/servo,dhananjay92/servo,hyowon/servo,vks/servo,splav/servo,brendandahl/servo,tafia/servo,szeged/servo,rnestler/servo,aweinstock314/servo,vks/servo,bjwbell/servo,nnethercote/servo,rnestler/servo,pyecs/servo,codemac/servo,tschneidereit/servo,runarberg/servo,walac/servo,mdibaiee/servo,dsandeephegde/servo,mdibaiee/servo,dati91/servo,pyecs/servo,ConnorGBrewster/servo,canaltinova/servo,RenaudParis/servo,nerith/servo,pyecs/servo,jlegendary/servo,ConnorGBrewster/servo,mt2d2/servo,notriddle/servo,pgonda/servo,szeged/servo,aidanhs/servo,GreenRecycleBin/servo,aweinstock314/servo,DominoTree/servo,g-k/servo,sadmansk/servo,splav/servo,upsuper/servo,canaltinova/servo,runarberg/servo,samfoo/servo,deokjinkim/servo,pyecs/servo,emilio/servo,WriterOfAlicrow/servo,tempbottle/servo,upsuper/servo,brendandahl/servo,deokjinkim/servo,jgraham/servo,saratang/servo,g-k/servo,pyfisch/servo,notriddle/servo,dagnir/servo,ConnorGBrewster/servo,cbrewster/servo,CJ8664/servo,tempbottle/servo,DominoTree/servo,mbrubeck/servo,A-deLuna/servo,rentongzhang/servo,nick-thompson/servo,jlegendary/servo,jgraham/servo,sadmansk/servo,jimberlage/servo,eddyb/servo,zentner-kyle/servo,j3parker/servo,avadacatavra/servo,pyfisch/servo,tafia/servo,brendandahl/servo,boghison/servo,wartman4404/servo,paulrouget/servo,evilpie/servo,WriterOfAlicrow/servo,nerith/servo,mattnenterprise/servo,AnthonyBroadCrawford/servo,KiChjang/servo,szeged/servo,s142857/servo,tempbottle/servo,dagnir/servo,codemac/servo,rentongzhang/servo,ryancanhelpyou/servo,thiagopnts/servo,walac/servo,jdramani/servo,wpgallih/servo,cbrewster/servo,rixrix/servo,brendandahl/servo,meh/servo,youprofit/servo,rixrix/servo,saneyuki/servo,WriterOfAlicrow/servo,sadmansk/servo,mdibaiee/servo,thiagopnts/servo,nnethercote/servo,notriddle/servo,zentner-kyle/servo,g-k/servo,nrc/servo,evilpie/servo,cbrewster/servo,s142857/servo,emilio/servo,jimberlage/servo,mt2d2/servo,mbrubeck/servo,wpgallih/servo,peterjoel/servo,splav/servo,samfoo/servo,dhananjay92/servo,meh/servo,peterjoel/servo,GyrosOfWar/servo,eddyb/servo,A-deLuna/servo,saratang/servo,jgraham/servo,huonw/servo,tschneidereit/servo,saneyuki/servo,SimonSapin/servo,KiChjang/servo,walac/servo,kindersung/servo,pyecs/servo,akosel/servo,steveklabnik/servo,boghison/servo,akosel/servo,pyfisch/servo,DominoTree/servo,wartman4404/servo,RenaudParis/servo,nrc/servo,rixrix/servo,sadmansk/servo,karlito40/servo,emilio/servo,upsuper/servo,eddyb/servo,ConnorGBrewster/servo,aidanhs/servo,rentongzhang/servo,GyrosOfWar/servo,anthgur/servo,zhangjunlei26/servo,upsuper/servo,evilpie/servo,dsandeephegde/servo,j3parker/servo,zentner-kyle/servo,nrc/servo,wpgallih/servo,runarberg/servo,pyfisch/servo,walac/servo,ryancanhelpyou/servo,cbrewster/servo,saneyuki/servo,anthgur/servo,dati91/servo,larsbergstrom/servo,dhananjay92/servo