Use lighter atomic counters instead of mutexes

Where appropriate, it makes sense to use lighter weight atomic counters
instead of mutexes.
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.