Cleaned up implementation of cmd RHS function. As per Dave's advice, it was unnecessary to modify the RhsFunctionContext to pass in the agent -- the agent can just be passed into the CmdRhsFunction's constructor.

So most of these files are essentially being reverted to how they were.