add each_context method

I've added an implementation of the `each_context` method, which seems to be missing at the moment