Allow setting a user-agent when testing URLs

Closes #1