Refactor filtering and mapping for url extraction

We make a few changes to the URLs we extract such as filtering out
URLs that don't match a certain predicate and adjusting the values
that we hold.

This change converts these operations to use a common set of
`filterURLs` and `mapURLs` functions that can be passed a function to
call for each item in the array of *url.URL elements.
Potentially in the future, but not right now. This looks like the only place that it's going to be used.

Should we want to abstract further it might be better to use one of the packages other people have written that cover more of the common constructs like `map`, `filter` and `reduce` and have more similarities with Python's `itertools`.