Added support for specifying an output directory not just an output file

Also cleaned up the boolean logic for when out and dir args are added to command line