Gofer 1.0 porting: the changes below are the result of getting rid of the mock_agent and just using python-mock.