Added 'Criterion' class for specifying abstract termination / restart criteria.