Implement basic getblocktemplate BIP0022 support.

This commit implements the non-optional and template tweaking support for
the getblocktemplate RPC as defined by BIP0022.  This implementation does
not yet include long polling support.

This is work towards #124.
Implement getblocktemplate long poll support.

This commit implements the long polling portion of the getblocktemplate
RPC as defined by BIP0022.  Per the specification, each block template is
returned with a longpollid which can be used in a subsequent
getblocktemplate request to keep the connection open until the server
determines the block template associated with the longpollid should be
replaced with a new one.

This is work towards #124.
Implement BIP0023 basic pool extensions support.

This commit implements the basic pool extension portion of the getblocktemplate
RPC as defined by BIP0023.

This is work towards #124.
Implement BIP0023 getblocktemplate block proposals.

This commit implements block proposals as defined by BIP0023.

This is work towards #124.
Implement some BIP0023 getblocktemplate mutations.

This commit implements a portion of the mutations section of BIP0023.
In particular, it adds the mutable, mintime, maxtime, and noncerange keys
to the returned block template along with indicating support for the time,
transactions/add, prevblock, and coinbase/append mutations.  Also, the
addition of the mintime and maxtime fields imply support for the
time/decrement and time/increment mutations.  Further, if the caller
indicates the coinbasevalue capability, the coinbasetxn field will be
omitted thereby implying support for the coinbase and generation
mutations.

Closes #124.
Seed random generator in RPC server during init.

Rather than reseeding the PRNG used throughout the RPC server on each
call, do it once during init.

Suggested by @jrick
Address a few more comments.
each goroutine needs its own random source.

caught by the race detector.
organize.

no objections from @davecgh
Put mutexes in exported functions.
We only care about the peers.json file...
Correct pushGetMerkleBlock throttling.

This commit corrects the check which sends in the done channel when
pushing merkle blocks that have no transactions to go with them.
Remove outdated comment.
Use chan struct{} for tx/blockProcessed chans.

These channels are being used as semaphores, so it's more efficient to use
a 0-byte type and allow compiler optimizations for the specific use case.
Use chan struct{} for throttling related chans.

The done and wait channels used to throttle outgoing data are being used
as semaphores.  As mentioned in the previous commit, it's more efficient
to use a 0-byte type and allow compiler optimizations for the specific use
case.
Update to account for recent btcchain API changes.
Fix off-by-one making rescanfinished notification.

Fixes #150.

ok @davecgh
IMPORT PATH MODIFICATION CHANGESET
----------------------------------

Please use this changeset as the first one on top of the conformal codebase.
Note that if there are new imports, they need to be changed as part of this
changeset. In general, use "git rebase" on github.com/conformal's version
and apply this changeset first.