allow using of custom user agents, add tests for cookie handling