Feature/tests user agent

These are some initial tests. It's difficult to make these tests exhaustive, so I tried to cover the main ones, but it could be that I'm still missing some.

If anyone has comments on the way this is tested, please do tell.

Addresses #544