Added test RPC code courtesy of Tobi Oetiker