add ability to parse from a file object

@msabramo please review.