Remodeled the permission system, removed legacy data components and create permission Api.

New manager views for the permissions are still needed to be implemented.