Fix for backwards incompatible changes to requests library.

See https://github.com/kennethreitz/requests/issues/1034

Also moved headers from Session to request as per ebroder's
comment.