Setup index and search stats
Fix wait function
Move try/catch up the stack

Move the try/catch up the stack.  Make sure index_end is always
called.  Define a macro to calculate elapsed time.
Add convenient stat API

Add a convenient set of stat functions rather than sending tuples
directly.

Update latency and throughput stats only when the index or query
operation is successful.  In the case of failure, simply decrement the
pending counter.
Update HTTP search to use stat API
Update stat registration to be like KV stats
Avoid sending stats through server process

Do as Riak KV stats does and bypass the server process for stat
updates.
Fix typo
Move all private funs under private header
Add index_fail stat, remove pending stat

Add an index_fail stat.  While adding this new stat I also added tests
for the pending stat and found negative values for the count.  After
struggling with it for a while I decided the pending count is more
trouble then it's worth at the moment.  There may be other ways this
can be done if it is absolutely needed.
Use sidejob to send stat updates

Do as Riak KV does and send stat updates through sidejob.  This is
done to take pressure off the Riak KV VNodes.  Given Yokozuna's index
hook currently runs on the KV VNode process if makes sense to apply
this strategy in Yokozuna as well.
Use newer style stats

After discussing with Joseph Blomstedt I learned that the Riak KV stat
module has a lot of extra cruft for legacy reasons.  He pointed out to
me that the Riak Pipe stats module would serve as a better base for
Yokozuna stats.  It makes use of a newer style stats layout that
supposedly makes things easier.  I went ahead and mimicked it as best
as possible.  The only major exception is I have left in the sidejob
usage because some Yokozuna stats will fire on the KV VNode and we
want to protect them from stats work as much as possible.
Merge remote-tracking branch 'origin/develop' into feature/er/new-stats

Conflicts:
	src/yz_pb_search.erl
	src/yz_wm_search.erl
Merge remote-tracking branch 'origin/develop' into feature/er/new-stats

Conflicts:
	src/yz_app.erl
Merge pull request #179 from basho/feature/er/new-stats

Setup Index and Search Stats