Creates a new category when a new page is added. Also deletes the cat when the page is permanently deleted