Add further validation, tests, and allow output to p2sh address

All offline validation tests are now there, with some basic tests. The validate.all function should be run before someone signs a transaction. If all validations say "success", and they are satisfied with the outputs and fees, then they are OK to sign the transactions.

Basic tests are included, along with nontrivial tests for cmd_raw_create and cmd_raw_sign.

Also in commit 795e5c7 the ability to pay to a p2sh address is included.

By hand I have tested this code with 2-of-3 and 3-of-5 p2sh multisig transactions. I did one test with two outputs, where one output paid back to a p2sh address. And another test with real bitcoins on livenet.