Part two of bug #23 fixes.

Only consider scoped perms if their target is a content type (because
otherwise things have gone wrong.)

Add another ACL test to check for correct scoped permission setting.
Add a check to ensure no owner permissions have been granted with a scope
Fix perm script