Fixes related to to sys.argspec.

Fixing #15774, argspec was showing additional functions based on the module that was passed.  eg. showing cmd.which and cmd.which_bin when the module cmd.which was passed.  This borrows functionality from the sys.doc function for handling this situation.