Adding support for passing in the current working directory

This allows passing in the current working directory for the command using the cwd option.