Transaction: use the type embedded in the signature
crypto/ecdsa: moves HmacSHA256 to crypto
ecdsa: add serializeSigCompact and tests

This also adds tests for all other ECDSA serialize/parsing functions.
The k, r, s and D values were sourced from test vectors on
https://bitcointalk.org/index.php?topic=285142.40 .

The compact signatures (aka, i values) were generated from bitcoinjslib, but they
are straight forward anyway.
ec: add better test vectors for ECPointFp encode/decode

These test vectors were generated internally.
message: use serializeSigCompact
ec: getEncoded now uses Buffer API
ecdsa: parseSig now uses buffer API
ecdsa: parseSigCompact use Buffer API

parseSigCompact also now returns the correct recovert parameter without
the need to subtract the compression bit.
This makes it easier to use.
ec: decodeFrom now uses Buffers and handles errors
ec/dsa: recovery param now used consistently

Also added an assertion rather than massaging the input.
Merge pull request #182 from dcousens/ectests

EC Tests and further use of Buffers