Improve Script API

fixes https://github.com/bitpay/bitcore/issues/649