Added a pluggable SecurityContextFactory that can be configured in DeploymentInfo.
Minor clean up