Make the code more readable

Previously the code used a lot of long singleline,
brace-less expressions. This patch runs it through
astyle making it look more like the rest of our
code and add {}

Change-Id: I7fed1d791ed63d1b538b4fe792c18d57247cac4a
Reviewed-on: http://review.couchbase.org/34896
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>