Parts of test code is based on work by laanwj in Core PR8636
TODO items:
[ ] Create separate diff for activation code (should replace IsNullDummyEnforced
[ ] Move txtools fix into separate diff
[ ] Find a code name for protocol upgrade
[ ] Move replay protection into the future, so as these tests don't have to deal with it.