Rebased and fixed outstanding issues in #11256
Also removed some unnecessary refactoring to simplify review
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--174a7506f384e20aa4161008e828411d-->
Reviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
utACK 092defc. Could have release note.
Tested ACK 092defc216c9fe2a6d32bd670a5f5215c143a48c
@luke-jr the following also get weight key in the result:
getrawmempool, getmempoolancestors and getmempooldescendants with verbose=true/rest/mempool/contents.json.Do you mind adding tests for those (at least test it's numeric) and add release notes?
<!--cf906140f33d8803c4a75a2196329ecb-->Needs rebase