added "which" command, stolen from twisted module implementation