Categories functionality added

I need to make this a module.
refactoring the add and remove functions.