This is part one of multiple to split up rpcwallet.cpp into smaller, more logical units.
See #23622 for context and overall plan. I’ll open PRs in stages to hopefully minimise conflicts.
Can be reviewed with --color-moved=dimmed-zebra
The end goal can be seen here: https://github.com/meshcollider/bitcoin/tree/202111_split_walletrpc