expand list of permissions
Remove unused templates
Added support for hidden apps (bug 1019249, 1019251)