auto merge of #3964 : mrobinson/servo/code-duplication, r=larsbergstrom
auto merge of #3964 : mrobinson/servo/code-duplication, r=larsbergstrom

It is possible to share the code which creates root layers.

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