Extract common code from dispatch projects (part 1)

Missing from this PR:
- Extract common code between RestDispatchAsync and RpcDispatchAsync.
- Add back old dispatch-client (rpc) classes with an `@Deprecated` annotation