Changed context <-> class priority

Now the all parent classes are searched for a context first and then the
next context is taken.