added exception handling for context.__getitem__
moved the resolution of Context elements into a separate function
getting there with top-level context