Refactor category creation

If the user tries to create a category with a name that already exists,
let's pretend we just created it and use the existing category instead
of failing.