[ticket/991] Add sorting of categories