Refactor migrateEncodedLegacyCountryParam
Refactor migrateEncodedLegacyCountryParam

To make it clearer what is going on. Also includes leading `~` now if it returns only a single entity.

owid/owid-grapher,OurWorldInData/owid-grapher,owid/owid-grapher,owid/owid-grapher,OurWorldInData/owid-grapher,owid/owid-grapher,OurWorldInData/owid-grapher,OurWorldInData/owid-grapher,OurWorldInData/owid-grapher,owid/owid-grapher