Refactory of RPC test script: it can now be included as module