tools.which: adding some docs and cleanup.