Turn struct pkg_categories into a pkg_object
Remove unused variable
Add new pkg_object_count public function
Use pkg_object_count instead of pkg_list_count