Adding and deleting categories via Ajax is now functional

Also centralized the javascript for categories in the main categories
php file.