Using argparse.FileType instead of opening files manually

Some clean up of pep8 errors. I didn't add anything with the line
lengths.