Added support for passing in files as well as filenames.