Security manager fixes

Fix a mess of privileged action problems, introduce privileged interceptors, generally prepare to be able to operate within a security manager.