I made a bunch of changes to the pull request to store territory codes lower-case, and allow asking for their names from either an upper-case code or a lower-case code. Could you take another look?

Thanks!