fix sighash opts + add tests
Merge pull request #1321 from matiu/builderOtps

fix sighash opts + add tests