Tidy up script.js

There's still some very odd coupling between TransactionOut and Script. Should not break much.