Use requests instead of urllib2 in a few places

This simplifies handling the cookies.