Use file objects instead of filenames

Seems like a good idea to use file objects instead of filenames so that the source can be from multiple places. File like objects are used all over the place in the python world as well.

We're using this change in the Hue project. So, please let us know if there are bugs or there should be changes outside of the design change!