Implemented flattening and unflattening of context parameters.
More work on context parameters.
Finished basic support for all context parameters.