Added _flatten and _write_sudoers