Allow arbitrary methods to be mocked

I've added some code to allow arbitrary methods to be mocked (as long as they are supported by the underlying server)