fix textlib.getCategoryLinks() for adjacent categories

the regex has been fixed (take #3):
- characters in the sortKey are now matched in non-greedy mode
- spaces at the end of the sortKey are not ignored anymore

test_adjoining_links() has been added to TestCategoryRearrangement
to make sure that the regular expression always works well.

Change-Id: Ia7dbe5007c34af8a457e8952ef727928e02f8d4d
Merge "fix textlib.getCategoryLinks() for adjacent categories"