Refactor importwallet to extract data from the file and then import
Refactor importwallet to extract data from the file and then import

Instead of importing keys and scripts as each line in the file is
read, first extract the data then import them.

MeshCollider/bitcoin,tjps/bitcoin,namecoin/namecore,ElementsProject/elements,GroestlCoin/GroestlCoin,bitcoinsSG/bitcoin,litecoin-project/litecoin,n1bor/bitcoin,bitcoinsSG/bitcoin,MarcoFalke/bitcoin,bespike/litecoin,domob1812/namecore,ahmedbodi/vertcoin,r8921039/bitcoin,GroestlCoin/bitcoin,myriadcoin/myriadcoin,wellenreiter01/Feathercoin,andreaskern/bitcoin,tecnovert/particl-core,alecalve/bitcoin,untrustbank/litecoin,Sjors/bitcoin,nikkitan/bitcoin,bitcoinknots/bitcoin,achow101/bitcoin,achow101/bitcoin,tjps/bitcoin,kallewoof/bitcoin,ahmedbodi/vertcoin,rnicoll/bitcoin,tjps/bitcoin,bitcoinsSG/bitcoin,yenliangl/bitcoin,mitchellcash/bitcoin,nikkitan/bitcoin,lateminer/bitcoin,bitcoin/bitcoin,jlopp/statoshi,qtumproject/qtum,qtumproject/qtum,jambolo/bitcoin,gjhiggins/vcoincore,instagibbs/bitcoin,EthanHeilman/bitcoin,GroestlCoin/bitcoin,OmniLayer/omnicore,MeshCollider/bitcoin,n1bor/bitcoin,kallewoof/bitcoin,alecalve/bitcoin,OmniLayer/omnicore,domob1812/bitcoin,rnicoll/dogecoin,achow101/bitcoin,untrustbank/litecoin,gjhiggins/vcoincore,jambolo/bitcoin,bitcoin/bitcoin,untrustbank/litecoin,myriadcoin/myriadcoin,ahmedbodi/vertcoin,MarcoFalke/bitcoin,particl/particl-core,fujicoin/fujicoin,bitcoinknots/bitcoin,domob1812/namecore,wellenreiter01/Feathercoin,jambolo/bitcoin,n1bor/bitcoin,FeatherCoin/Feathercoin,wellenreiter01/Feathercoin,Sjors/bitcoin,MarcoFalke/bitcoin,bespike/litecoin,ajtowns/bitcoin,DigitalPandacoin/pandacoin,lateminer/bitcoin,anditto/bitcoin,instagibbs/bitcoin,sstone/bitcoin,cdecker/bitcoin,r8921039/bitcoin,mm-s/bitcoin,n1bor/bitcoin,yenliangl/bitcoin,jnewbery/bitcoin,myriadteam/myriadcoin,domob1812/bitcoin,kallewoof/bitcoin,jnewbery/bitcoin,AkioNak/bitcoin,afk11/bitcoin,jambolo/bitcoin,yenliangl/bitcoin,midnightmagic/bitcoin,mruddy/bitcoin,OmniLayer/omnicore,namecoin/namecoin-core,jnewbery/bitcoin,monacoinproject/monacoin,achow101/bitcoin,rnicoll/bitcoin,litecoin-project/litecoin,namecoin/namecoin-core,cdecker/bitcoin,yenliangl/bitcoin,nikkitan/bitcoin,Xekyo/bitcoin,mruddy/bitcoin,jamesob/bitcoin,mitchellcash/bitcoin,namecoin/namecoin-core,alecalve/bitcoin,AkioNak/bitcoin,tjps/bitcoin,midnightmagic/bitcoin,particl/particl-core,r8921039/bitcoin,fanquake/bitcoin,untrustbank/litecoin,pataquets/namecoin-core,n1bor/bitcoin,Sjors/bitcoin,myriadteam/myriadcoin,GroestlCoin/GroestlCoin,domob1812/bitcoin,Xekyo/bitcoin,fanquake/bitcoin,CryptArc/bitcoin,DigitalPandacoin/pandacoin,vertcoin/vertcoin,ahmedbodi/vertcoin,domob1812/namecore,dscotese/bitcoin,bespike/litecoin,qtumproject/qtum,jlopp/statoshi,qtumproject/qtum,fujicoin/fujicoin,jamesob/bitcoin,gjhiggins/vcoincore,pataquets/namecoin-core,namecoin/namecoin-core,sstone/bitcoin,namecoin/namecore,EthanHeilman/bitcoin,fujicoin/fujicoin,jtimon/bitcoin,domob1812/bitcoin,dscotese/bitcoin,fujicoin/fujicoin,andreaskern/bitcoin,MarcoFalke/bitcoin,litecoin-project/litecoin,kallewoof/bitcoin,domob1812/namecore,bitcoin/bitcoin,peercoin/peercoin,sstone/bitcoin,jamesob/bitcoin,rnicoll/bitcoin,FeatherCoin/Feathercoin,mm-s/bitcoin,ajtowns/bitcoin,tecnovert/particl-core,andreaskern/bitcoin,qtumproject/qtum,sstone/bitcoin,wellenreiter01/Feathercoin,EthanHeilman/bitcoin,bespike/litecoin,jlopp/statoshi,droark/bitcoin,sipsorcery/bitcoin,rnicoll/dogecoin,droark/bitcoin,myriadteam/myriadcoin,sipsorcery/bitcoin,particl/particl-core,sipsorcery/bitcoin,anditto/bitcoin,rnicoll/bitcoin,OmniLayer/omnicore,mm-s/bitcoin,CryptArc/bitcoin,GroestlCoin/GroestlCoin,apoelstra/bitcoin,gjhiggins/vcoincore,afk11/bitcoin,droark/bitcoin,dscotese/bitcoin,ElementsProject/elements,DigitalPandacoin/pandacoin,CryptArc/bitcoin,kallewoof/bitcoin,apoelstra/bitcoin,myriadteam/myriadcoin,bitcoinsSG/bitcoin,mitchellcash/bitcoin,fujicoin/fujicoin,tjps/bitcoin,Xekyo/bitcoin,prusnak/bitcoin,OmniLayer/omnicore,jonasschnelli/bitcoin,FeatherCoin/Feathercoin,mitchellcash/bitcoin,rnicoll/bitcoin,JeremyRubin/bitcoin,monacoinproject/monacoin,GroestlCoin/bitcoin,andreaskern/bitcoin,particl/particl-core,ajtowns/bitcoin,practicalswift/bitcoin,dscotese/bitcoin,peercoin/peercoin,instagibbs/bitcoin,Xekyo/bitcoin,jamesob/bitcoin,bitcoin/bitcoin,DigitalPandacoin/pandacoin,tecnovert/particl-core,cdecker/bitcoin,bespike/litecoin,yenliangl/bitcoin,domob1812/namecore,pataquets/namecoin-core,mruddy/bitcoin,MeshCollider/bitcoin,Xekyo/bitcoin,namecoin/namecoin-core,yenliangl/bitcoin,MeshCollider/bitcoin,ajtowns/bitcoin,bitcoinknots/bitcoin,JeremyRubin/bitcoin,dscotese/bitcoin,namecoin/namecore,mitchellcash/bitcoin,apoelstra/bitcoin,qtumproject/qtum,bitcoinknots/bitcoin,myriadcoin/myriadcoin,myriadteam/myriadcoin,midnightmagic/bitcoin,jamesob/bitcoin,jonasschnelli/bitcoin,litecoin-project/litecoin,pstratem/bitcoin,prusnak/bitcoin,vertcoin/vertcoin,myriadcoin/myriadcoin,rnicoll/dogecoin,fujicoin/fujicoin,droark/bitcoin,monacoinproject/monacoin,particl/particl-core,JeremyRubin/bitcoin,ElementsProject/elements,anditto/bitcoin,DigitalPandacoin/pandacoin,midnightmagic/bitcoin,mruddy/bitcoin,pstratem/bitcoin,FeatherCoin/Feathercoin,afk11/bitcoin,pstratem/bitcoin,practicalswift/bitcoin,practicalswift/bitcoin,GroestlCoin/GroestlCoin,domob1812/namecore,namecoin/namecore,instagibbs/bitcoin,Sjors/bitcoin,ahmedbodi/vertcoin,afk11/bitcoin,n1bor/bitcoin,namecoin/namecoin-core,anditto/bitcoin,droark/bitcoin,AkioNak/bitcoin,JeremyRubin/bitcoin,kallewoof/bitcoin,alecalve/bitcoin,AkioNak/bitcoin,jtimon/bitcoin,lateminer/bitcoin,tecnovert/particl-core,midnightmagic/bitcoin,apoelstra/bitcoin,jtimon/bitcoin,AkioNak/bitcoin,mm-s/bitcoin,lateminer/bitcoin,pstratem/bitcoin,EthanHeilman/bitcoin,untrustbank/litecoin,domob1812/bitcoin,gjhiggins/vcoincore,peercoin/peercoin,EthanHeilman/bitcoin,wellenreiter01/Feathercoin,FeatherCoin/Feathercoin,GroestlCoin/bitcoin,achow101/bitcoin,nikkitan/bitcoin,Sjors/bitcoin,r8921039/bitcoin,peercoin/peercoin,Xekyo/bitcoin,myriadcoin/myriadcoin,cdecker/bitcoin,afk11/bitcoin,GroestlCoin/GroestlCoin,mm-s/bitcoin,practicalswift/bitcoin,ajtowns/bitcoin,jlopp/statoshi,untrustbank/litecoin,vertcoin/vertcoin,tecnovert/particl-core,ajtowns/bitcoin,alecalve/bitcoin,vertcoin/vertcoin,bitcoin/bitcoin,sstone/bitcoin,tjps/bitcoin,mruddy/bitcoin,domob1812/bitcoin,fanquake/bitcoin,bitcoin/bitcoin,lateminer/bitcoin,jtimon/bitcoin,gjhiggins/vcoincore,peercoin/peercoin,dscotese/bitcoin,jlopp/statoshi,ElementsProject/elements,ElementsProject/elements,GroestlCoin/bitcoin,particl/particl-core,pstratem/bitcoin,jonasschnelli/bitcoin,fanquake/bitcoin,andreaskern/bitcoin,r8921039/bitcoin,GroestlCoin/bitcoin,namecoin/namecore,sipsorcery/bitcoin,AkioNak/bitcoin,lateminer/bitcoin,jonasschnelli/bitcoin,vertcoin/vertcoin,achow101/bitcoin,namecoin/namecore,nikkitan/bitcoin,JeremyRubin/bitcoin,bespike/litecoin,practicalswift/bitcoin,vertcoin/vertcoin,mruddy/bitcoin,monacoinproject/monacoin,cdecker/bitcoin,pataquets/namecoin-core,instagibbs/bitcoin,sipsorcery/bitcoin,pstratem/bitcoin,ElementsProject/elements,sstone/bitcoin,jtimon/bitcoin,monacoinproject/monacoin,anditto/bitcoin,wellenreiter01/Feathercoin,jambolo/bitcoin,peercoin/peercoin,alecalve/bitcoin,EthanHeilman/bitcoin,pataquets/namecoin-core,CryptArc/bitcoin,rnicoll/dogecoin,GroestlCoin/GroestlCoin,droark/bitcoin,myriadteam/myriadcoin,FeatherCoin/Feathercoin,jlopp/statoshi,prusnak/bitcoin,JeremyRubin/bitcoin,apoelstra/bitcoin,litecoin-project/litecoin,sipsorcery/bitcoin,nikkitan/bitcoin,DigitalPandacoin/pandacoin,mm-s/bitcoin,rnicoll/bitcoin,jamesob/bitcoin,myriadcoin/myriadcoin,r8921039/bitcoin,ahmedbodi/vertcoin,bitcoinsSG/bitcoin,MarcoFalke/bitcoin,prusnak/bitcoin,afk11/bitcoin,cdecker/bitcoin,fanquake/bitcoin,MeshCollider/bitcoin,mitchellcash/bitcoin,apoelstra/bitcoin,bitcoinsSG/bitcoin,jnewbery/bitcoin,qtumproject/qtum,tecnovert/particl-core,OmniLayer/omnicore,jnewbery/bitcoin,MeshCollider/bitcoin,fanquake/bitcoin,jambolo/bitcoin,jonasschnelli/bitcoin,andreaskern/bitcoin,bitcoinknots/bitcoin,monacoinproject/monacoin,litecoin-project/litecoin,midnightmagic/bitcoin,pataquets/namecoin-core,instagibbs/bitcoin,prusnak/bitcoin,MarcoFalke/bitcoin,CryptArc/bitcoin,CryptArc/bitcoin,anditto/bitcoin,prusnak/bitcoin,practicalswift/bitcoin,jtimon/bitcoin,rnicoll/dogecoin