Stop modifying the passed tx in NewScript.

The only time we need to zero out scripts is for calcScriptHash which operates
on a deep copy anyway. This should make the tx passed to us unmodified now.
Add functions to count the number of signature operations in a script.

To be usd for validation. Most of the codepaths teste, a few tests
missing for cases needed tests in the validation codepaths too. To be
worked on in tree.