Fixed uri handling for history and some other commands.  Added better base class impersonation support