Fix stuff that was totally broken due to not having done a 'clean'. Tidy imports
Fix tests
Make default redirect a simple call, and fix a couple of FIXMEs
related to redirection.
Lots of fixes and cleanups to permission listing code, some of which
was quite broken. In order to parse the target of a permission a new
ContentType model has been introduced, and the ContentType enum
pluralised to ContentTypes.