Improve url resolver

I've broken out the `fixLinkUrl` function into its own utils module, and added a collection of test cases to ensure that it handles common edge cases.

This will help with an issue on the cssstats repo as well: https://github.com/mrmrs/cssstats/issues/93