Converted security to mostly use Java config to allow injection of preferences during initialization. Fixed scheduler issues.