Allow to specifiy a method to retrieve context.

Add the possibility to retrieve the context
by a method.
Merge pull request #1 from tawan/context_as_proc

Pass contexts as Proc objects.