Refactor transaction creation and transaction funding logic
Summary:
In preparation for more create transaction and fund transcation RPCs,
refactor the transaction creation and funding logic into separate
functions.
This is a partial backport of Core PR13557 : https://github.com/bitcoin/bitcoin/pull/13557/commits/58a8e28918025c28f19ba19cbaa4a72374162942
Test Plan:
make check ./test/functional/test_runner.py
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Subscribers: Fabien
Differential Revision: https://reviews.bitcoinabc.org/D4288