Unclusterfuck per-char and -sentence trimming from ApiQueryExtracts

Add tests. Comment out things that need to be fixed.

Change-Id: I21e1e3d99959147d89e6390c0572d2e16d6a3cbc
Merge "Unclusterfuck per-char and -sentence trimming from ApiQueryExtracts"