Changed the parse function to work on a file object instead of loading a filename form the filesystem.