#80: Automatic country assignment algorithm. Closes #92.