Preallocate the tx serialization buffer.
Benchmarking shows this is slightly faster due to avoiding the extra
garbage collection in addition to less peak memory usage.

ok @davecgh
Don't fail RPC server create due to single iface.

Rather than returning an error when creating the RPC server an it can't
listen on any of the specified interfaces, only error when it can't listen
on all of the specified interfaces.
Optimize rescan.

This change adds rescan fast paths for all current implementations of
the btcutil.Address interface.  Rather than encoding a payment address
string from a txout script, the minimum number of bytes (which depends
on the address type) are copied into a stack array and used as a
lookup key to a map exclusive for that address type.  This performs
better than the previous implementation due to avoiding the base58
encoding and generating less garbage (so each GC cycle completes
faster).

If the address type switch falls into the default (unhandled) case,
the encoded payment address is used as a fallback.  This keeps the
intended rescan behavior even when new implementations of
btcutil.Address are added without a rescan fast path.

Benchmarks indicate that when a fast path is followed, for 20 byte
RIPEMD-160 hashes (such as P2PKH and P2SH), skipping the payment
address encoding (and thus bypassing the base58 encoding code) can
result in map lookups up to 60x faster.
Bootstrap unspents with rescan request's outpoints.
Prevent blocking on RPC server messages after shutdown.

This change adds select statements to each channel write that may
occur from a non-RPCS goroutine to unblock once the server has begun
shutting down.  This prevents issues in clean shutdown where non-RPCS
goroutines may block indefinitely on message sends to the RPC server.
Add new logging subsystem for mining related ops.

This commit adds a new logging subsystem named MINR which is used for
logging mining releated operations.
Add options to control block creation settings.

This commit adds three new options which are intended to to be used by the
upcoming mining-related block template creation code.
Add infrastructure for creating a block template.

This commit adds a new function named NewBlockTemplate along with
supporting infrastructure which is part of the core functionality needed
to support mining.

In particular the function creates a new block template which contains a
fully populated block with a zero nonce that is ready to be solved as well
as additional information regarding the fees and number of signature
operations for each transaction included in the block.  The specific
transaction selection logic mirrors the reference implementation.

Various cleanup, optimizations, and comment suggestions provided by
@owainga.  Also contains some naming suggestions and comment fixes from
@flammit.