Also annotate metadata in TransactionProcessor

Annotation transactions weren't taking metadata into account at all.
This caused nasty issues when annotating across a mix of data and
metadata.

Changed applyAnnotations() to apply annotations to metadata as well
as data. To be safe and conservative, I only applied this to metadata
offsets entirely inside the range, not to the offsets on the edges.
This means annotations with comments at the end will still cause
problems. We may be able to fix that by making annotations smarter
and having them make themselves disappear when only applied to
metadata. Alternatively, reunifying data and metadata into a single
band will resolve this ambiguity.

Also factored out common code into a helper function and cleaned up
applyAnnotations() while I was in there, removing unneeded variables
in favor of calls to ElementLinearData methods.

Bug: 52127
Change-Id: Ie93fe50a46b13c240a6f56a25a989e0c978b663f
Merge "Also annotate metadata in TransactionProcessor"