ensure serialize/deserialize tx works on vectors

...the tx_valid and tx_invalid vectors from bitcoind can be used to check
whether serializing + deserializing transaction works correctly. Note that the
tx_valid and tx_invalid tests also need to be checked against the script
interpreter, which is not yet being checked.
CheckMinimalPush

When pushing data to the stack, sometimes there is more than one way to do it.
For instance, you can OP_1, which is the simplest way to push 1 to the stack.
However, you could also do OP_PUSHDATA1, followed by 1 (the amount of data),
and then a 1 (the data). That is another way to push 1 to the stack, but
consumes 3 bytes rather than just one. CheckMinimalPush tries to check that a
script is pushing data in the minimal way.

Note that in bitcoind, this function is called CheckMinimalPush, and as of the
time of this writing is located in interpreter.cpp. However, it is more
appropriate for this function to be located in script.js in fullnode. So that
is where the core logic is, and there is a bitcoind-like function that uses the
function from script.js.
use script's checkMinimalPush

The checkMinimalPush function in the script interpreter is redundant, and it is
actually used only one time in the script interpreter. We're better off just
using the one in script.js.
stack should be re-used in scriptPubKey

When executing the second half of a script, the scriptPubKey, which follows the
scriptSig, the stack should be retained and used as the starting stack. It is
basically as though the two scripts are one, at least with respect to the
stack.
fix cast-to-bool error

In bitcoind, a CastToBool function exists which casts stack values to a
boolean. Unfortunately I tried to do this using BN and got the "not" wrong. I
should replace this with a less confusing CastToBool function.
move script max size const to interpreter

MAX_SCRIPT_ELEMENT_SIZE is only used by the interpreter, and only relevant
there, so it is better moved to that file. At least for now.
castToBool

replace the confusing BN function with a new castToBool function, exactly like
the CastToBool function of bitcoind. This is much less confusing, much harder
to get tripped up on, and also faster.
enlightening comment
nhashtype is actually last byte, not last 4 bytes

A signature in a script in a transaction has one byte appended to the end which
indicates the hash type (e.g., SIGHASH_ALL, SIGHASH_SINGLE, etc.). There was a
bug in my signature encoding code that treated this as 4 bytes. That is
incorrect. It should be a single byte.
default nlocktime should be 0

The lock time is either at what block the tx is locked, or what time. If it is
set to 0, then it is not locked. 0 should be the default since most
transactions will not be locked.