move away from ThreadLocals to a Context object; stronger typing of mutating and non-mutating filters