Add Permissions Model.

This feature is a WIP.

Future PRs:
1) Add UI for App owners to specify permissions and provide descriptions.
2) Update Core to use permissions, including having a way to populate the perms DB with core permissions.
3) Add UI for viewing permissions, including users and groups that have those permissions.
4) Add UI for assigning permissions to groups and users.
I probably would have written this as self.name.split('.')[0]. The way you used here will error if there is not a period, while the split way is tolerant and just returns the whole string; not sure which way is better here (it might not matter).