Improve term normalization.

Fix Term::normalizeText to use the correct encoding, and use
a regular expression to remove control characters.

Change-Id: I2a21460f79619ae9b9c5f1b8beaf06e55bf61e9d