Add an entypoint to sign and verify a transaction input.

This handles merging in of previous scripts, also. Add tests for the important
paths. ok @davecgh