pbrpc refactoring

This prepares pbrpc to have asynchronous calls that can register a callback to call when the response is there.