Add extension methods for IUserIdentity.
Add SecurityHooks and refactor ModuleSecurity.