Adds support for GeoIP lookup

This uses a local copy of a GeoIP database to add the ISO 3166-1 alpha-3
country code (along with pycountry for the alpha-2 to alpha-3 mapping).
Adds unit tests and nose dependency to run tests.

This also includes some refactoring for readability and better test
coverage.