Bug fixed in transaction validation, transaction signing added

I found a couple of bugs in transaction validation:
1. The rules for skipping the right number of bytes for OP_PUSHDATA etc was off a bit
2. When adding abbreviated txoutputs for getHashForSig, the necessary 'varint' fields were omitted

Additionally I added a minimal amount of openssl code to get support transaction signing to work. The "regenerate key" function was copied from the satoshi bitcoin client.

Hopefully the tx validation fixes save you time. I realise my signing solution violates conventions (it has an internal malloc, I didn't finish documenting it) so you'll probably prefer to write your own (this was a last minute fix so that students could get it to work).