Stateful Offline Contextual Policy Evaluation and Learning