Add updatecategories command

This command updates the categories counts.