refactored repo_tag_from_urn and added unit test

Trying to install a package from a specific repository, I looked into the code providing this functionality. It took me some time figuring out what the function repo_tag_from_urn was supposed to do and after some testing I decided to refactor it to make it more readable and keep the same functionality (I believe). There was an error in it anyway, referring to ``source.inspect`` when it probably should be ``urn.inspect``.

Where is this URN-notation coming from anyway? The only relevant hits on google point directly to this repository!

I think the tailing comma here is failing the tests.