Remove trailing whitespace.
Add simple PContext definition and extraction from rule.
Add transformation function M(q)