Generate slug when adding new app.

No issue
- Remove duplicate code from model_posts_spec.
- Add slug generation to app model
- Test slug generation on app model
Merge pull request #3089 from halfdan/app-slug

Generate slug when adding new app.