Replace url formats with a buildUrl function

This commit adds buildUrl to enable arbitrary beehive url
schemes (e.g., http, https, ...).
Change api URLs

/hive/* -> /api/*
Add api for hive state

State is an api endpoint that returns the current state of the hive.
That includes its id, its address, and the list of its peers.
Change default raft tick to 100ms
Use state api to fetch peer infos
Refresh peer info only if there is no meta

When there is an existing meta file, we skip refreshing peers. This
makes implementation simpler but it's not ideal. We will improve on
this later.
Change application options

We relied on specific flags and settings for application options. This
commit switches from that mechanism to generic functional options. As a
result options are passed right when the application is created. And
cannot be changed afterwards. We also dropped support for commit threshold
as it is not required in our new design.
Add heartbeat and election ticks to node
Cache proxies for peers in hive

We used to create one proxy for each raft message. We now keep the
proxies in the hive.
Add timeout to connpool

Connection pools used to rely on a dialer function to support timeout.
This commit changed the implementation to use net.Dialer directly so
that the user can fine tune connection deadlines and timeouts.
Add AppNonTransactional option
Cache proxies in hive and bees

This commit cache the proxies in bees and hive for sending raft
messages. This is essential for preventing multiple connections to a
dead peer.
Reimplement stat collectors

The new implementation is simpler and avoids storing a state at the
optimizer. All migration decisions are made based on incoming messages.
Add Timer

Timer is a generic detached handler that calls a function on
pre-specfied tick.
Add a local stat poller based on Timer
Add OptimizeThresh option

OptimizeThresh option represents the threshold used by the local
stat poller. Whenever the incoming message rate of a bee goes beyond
this threshold, the poller will notify the optimizer.
Add NewTimer to create detached timers
Fix nit in registry
Add String() to app
Improve the pingpong example

This commit changes the behavior of pinger and pongers:
1. it only pongs to pings that are repliable.
2. it pongs with the same sequence as pings.
3. it pings with seq + 1 of pongs.

This commit also improves log messages of this example.