DDF-482 added new context policy manager and api to write a custom one