Replace delayed query parameters with transaction flags.

Callers should instead use applyBatch(), which now delays
any visible updates until the transation finishes.  This
partially fixes http://b/2075275

This change also fixes a bug where aggregated visibility
wasn't being updated correctly.  Wrote new unit tests to
verify correct behavior.
3 files changed