Almost complete model.

Lacks models for sharing, customizations and application settings.
DB calls fixed on paper.