Use requests instead of mechanize.

(Also shift some code around in the client.)