Wire up the buffered cache to db transactions

Make transaction usage for commiting changes explicit.  At the same
time wire up BufferedCache to only write to memcached when db
transaction completes.

The TreeRepository uses BagOStuff instead of BufferedCache, this
still needs to be fixed for the cache to stay consistent.

Change-Id: Iba2ce9c2e87164f8f54ac29b58f92895da2e24b6
Merge "Wire up the buffered cache to db transactions"