Part 1 of many for incorporating changes from https://github.com/bitcoinxt/bitcoinxt/pull/487
The goal is to improve the test suite so that it doesn't fail post-fork.
This diff differs from the original primarily in variable/function naming and other minor cleanups.
Co-authored-by: Jason B. Cox <contact@jasonbcox.com>