Refactor opcode test to reduce redundancy
Summary: This will ensure that newly created tests will test all the flags painlessly.
Test Plan:
make check
Reviewers: #bitcoin_abc, jasonbcox
Reviewed By: #bitcoin_abc, jasonbcox
Subscribers: jasonbcox
Differential Revision: https://reviews.bitcoinabc.org/D1221