Trimming leading and trailing whitespaces from terms, definitions and links

...to avoid terms not being picked up because of spaces being present in the term but not in the text.

Change-Id: I92990964191eb9ba2dd0f4f66ccd2ca90d763256