[FEATURE] Categories

__Tasks:__

- [ ] test coverage
- [ ] gather feedback for my changes
- [ ] submit changes to the documentation
- [ ] adjust to changes in https://github.com/sulu-cmf/sulu/pull/270

__Informations:__

| Q             | A
| ------------- | ---
| Tests pass?   | yes
| Fixed tickets | none
| BC Breaks     | none
| Doc           | none
@danrot could you split that function please in smaller peaces?