Removed hashType byte cast.
Update for recent btcec API changes.

This change is introduced so that btcwallet will continue to compile after
issue 6 in btcec is merged.
Added tx ids to ListReceivedByAddress result
implemented ListReceivedByAccount
Provide new wallet address manager package.

This commit implements a new secure, scalable, hierarchical deterministic
wallet address manager package.

The following is an overview of features:

- BIP0032 hierarchical deterministic keys
- BIP0043/BIP0044 multi-account hierarchy
- Strong focus on security:
  - Fully encrypted database including public information such as
    addresses as well as private information such as private keys and
    scripts needed to redeem pay-to-script-hash transactions
  - Hardened against memory scraping through the use of actively clearing
    private material from memory when locked
  - Different crypto keys used for public, private, and script data
  - Ability for different passphrases for public and private data
  - Scrypt-based key derivation
  - NaCl-based secretbox cryptography (XSalsa20 and Poly1305)
  - Multi-tier scalable key design to allow instant password changes
    regardless of the number of addresses stored
- Import WIF keys
- Import pay-to-script-hash scripts for things such as multi-signature
  transactions
- Ability to export a watching-only version which does not contain any
  private key material
- Programmatically detectable errors, including encapsulation of errors
  from packages it relies on
- Address synchronization capabilities

This commit only provides the implementation package.  It does not
include integration into to the existing wallet code base or conversion of
existing addresses.  That functionality will be provided by future
commits.
Allow injection of crypto keys into the manager.

Useful to test error conditions.

Also provide a new function that wraps snacl.GenerateCryptoKey(),
defined as a variable so that it can be replaced in tests.
Unexport the cryptoKey type.

The crypto key type unsed in the manager is not needed outside of the
package.  Also, rather than having the newCryptoKey func return the
specific cryptoKey type, make it return the EncryptorDecryptor interface.
This will allow it to be overridden with another type that implements the
interface from the tests.
Move most of txToPairs into a separate function

That function doesn't need a Wallet instance to run, so we can
test it easily, unlike txToPairs.
Improve the new TestCreateTx and a few other tests

Now that test actually checks the created tx is what we expect.
Also adds a couple tests for selectInputs.
Move more code out of createTx() into a separate function

Also adds comments for new functions/methods
A couple small improvements to tests
Move an error checking to the if block where it belongs
Now createTx() adds one input at a time

First to cover the total amount from all outputs, then it estimates a minimum
fee and adds more inputs (again, one at a time) if necessary.
Remove unnecessary err declaration and fix arg order of InsufficientFunds
A bunch of fixes suggested by jrick
Attempt at fixing TestCreateTx
Revert a change to signMsgTx that could caused it to return without signing
anything
Make sure we sign the tx after updating the value of the change output
s/InsufficientFunds/InsufficientFundsError
Change createTx() yet again so that it does not calls signMsgTx()
unnecessarily.

In order to do that it has to keep track of the size estimate for the tx, so
that it can estimate the fee.