new script API

fixes https://github.com/bitpay/bitcore/issues/602
nope. Just added a test for that anyway. Will rebase and update the PR