Added support for generic variables fitting patterns and generators and examples utilizing rules for code transformations.
Some more cleanups.