Refactor JSONRPCServer

 - Create validateJSONRPC method
 - Split-off JSONRPC handling from run() method
   to handleJSONRPC method.
Remove before and after code
Implement unittest for AddMethod