First crack at generalizing the creation and parsing of "pay_to" scripts.