CMS-4752 Move security code into own module.