The toolserver version to get categories seems to abort after 500 or so categories. Comment out this bit of code and only use the newer wmflabs site to get map categories.