textlib.py: categories with no indexing in categoryFormat

Avoid the need for 'categories' to support indexing.
In this way, any iterable can be provided as parameter.

Change-Id: I1d1b83fd09f4c1f87bd2756b640aa4df34dc34d5
Merge "textlib.py: categories with no indexing in categoryFormat"