2019-09-13 Added support for context-dependent transformations. Previous version of the code is stored in the pre_context branch.