Put code into main(), add directory creation in case path doesn't exit, and use default options in argparse to reduce number of tests