Allows Editing of Categories via popover.

What this does
---

 - allows editing of categories via popover (right click the cell)
 - Cleans up some code.

cc @joshpc @j-mutter