rpc: migrate JSONRPCRequest functionality into request.cpp
Summary:
This si a partial backport of Core PR16240 : https://github.com/bitcoin/bitcoin/pull/16240/commits/5c5e32bbe3dfa790dd8bb421fbd6301ae10b09f5
Depends on D6496
Test Plan:
ninja all check-all
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Subscribers: Fabien
Differential Revision: https://reviews.bitcoinabc.org/D6497