Cleanup in the RPC mechanism for forwards compatibility + a bunch more u...

...nit tests