Wrap file objects for requests

This references issue #112 and replaces pull request #113