use categoryinfo for the number of articles and subcats, pep8 changes

categoryinfo gives the number of articles and subcategories. We use
this information for the messages and use the generator functions
to process each article or subcat. This speeds up processing time
(f.e. 10% for "tree" with depth:3)

Made some pep8 changes.

Change-Id: I32e23ccfdc4a9e623fde93fcd161dd910879e9af
Merge "use categoryinfo for the number of articles and subcats, pep8 changes"