Begin implementation of context scopes.

Instead of context data being a single object, it now supports the same
scoping rules as keys.
Now the #index tag is always available.