Add cwd option and updated documentation.