Trim tag and category names and make sure they're not  empty