backport preferred master changes from 1.7 + required dependencies
(GET_TXID, NOP, Client_main.with_connection')